getresuid2
Get real, effective, and saved user/group ids
Usage
#define _GNU_SOURCE /* See feature_test_macros(7) */ #include <unistd.h>
int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
Library
Standard C library (libc, -lc)
Overview
getresuid() returns the real UID, the effective UID, and the saved set-user-ID of the calling process, in the arguments ruid, euid, and suid, respectively. getresgid() performs the analogous task for the process's group IDs.
Return value
On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error.
Errors
- EFAULT
-
One of the arguments specified an address outside the calling program's address space.
Releases
16 releases since Debian 2.0 (Hamm); the text changed 13 times.