setresuid(2) System Calls Manual setresuid(2) setresuid, setresgid - (libc -lc) #define _GNU_SOURCE /* feature_test_macros(7) */ #include int setresuid(uid_t ruid, uid_t euid, uid_t suid); int setresgid(gid_t rgid, gid_t egid, gid_t sgid); setresuid() . UID UID UID : UID UID UID . ( CAP_SETUID) UID UID UID . -1 . UID UID UID UID UID ( ). setresgid() GID GID GID ( GID GID ) . . -1 errno . : setresuid() UID 0 setresuid(). EAGAIN (UID) ( ruid ) . EAGAIN ruid ruid RLIMIT_NPROC . 3.1 ( ) EAGAIN execve(2). EINVAL . EPERM ( ) . setresuid() CAP_SETUID setresgid() CAP_SETGID. C . POSIX . NPTL POSIX UIDs GIDs . ( setresuid() setresgid()) . nptl(7). POSIX.1-2024. POSIX.1-2024. 2.1.44 glibc 2.3.2. HP-UX FreeBSD. setresuid() setresgid() 16 . 2.4 setresuid32() setresgid32() 32 . setresuid() setresgid() glibc . getresuid(2) getuid(2) setfsgid(2) setfsuid(2) setreuid(2) setuid(2) capabilities(7) credentials(7) user_namespaces(7) 3 . . : . 6.18 8 2026 setresuid(2)