setresuid(2) System Calls Manual setresuid(2) setresuid, setresgid - , LIBRARY Standard C library (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 set-user-ID UID, UID set-user-ID. ( Linux: CAP_SETUID) , UID set-user-UID . -1, . , UID, UID UID ( ) UID. , setresgid() GID, GID, GID ( GID GID) . On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error. : , setresuid() UID 0; -- setresuid(). EAGAIN UID (. . ruid UID ), . EAGAIN ruid UID , ID ruid RLIMIT_NPROC . Linux 3.1 ( ); EAGAIN execve(2). EINVAL . EPERM ( ) , . setresuid() CAP_SETUID; setresgid() -- CAP_SETGID. C ID . POSIX , . NPTL POSIX , UID GID . ( setresuid() and setresgid()) , , , . nptl(7). None. Linux 2.1.44, glibc 2.3.2. HP-UX, FreeBSD. setresuid() setresgid() Linux 16- . Linux 2.4 setresuid32() setresgid32(), 32- . glibc setresuid() setresgid() . . getresuid(2), getuid(2), setfsgid(2), setfsuid(2), setreuid(2), setuid(2), capabilities(7), credentials(7), user_namespaces(7) Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . setresuid(2)