int setrlimit(int resource, const struct rlimit *rlim) { struct ctx c = { .res = resource, .rlim = rlim }; __synccall(do_setrlimit, &c); if (c.err) { errno = c.err; return -1; } return 0; }
int __setxid(int nr, int id, int eid, int sid) { struct ctx c = { .nr = nr, .id = id, .eid = eid, .sid = sid }; switch (nr) { case SYS_setuid: case SYS_setreuid: case SYS_setresuid: c.rlim = 1; } __synccall(do_setxid, &c); if (c.err) { errno = c.err; return -1; } return 0; }