1GETRESUID(2) Linux Programmer's Manual GETRESUID(2)
2
3
4
6 getresuid, getresgid - get real, effective and saved user/group IDs
7
9 #define _GNU_SOURCE /* See feature_test_macros(7) */
10 #include <unistd.h>
11
12 int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
13 int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
14
16 getresuid() returns the real UID, the effective UID, and the saved set-
17 user-ID of the calling process, in the arguments ruid, euid, and suid,
18 respectively. getresgid() performs the analogous task for the
19 process's group IDs.
20
22 On success, zero is returned. On error, -1 is returned, and errno is
23 set appropriately.
24
26 EFAULT One of the arguments specified an address outside the calling
27 program's address space.
28
30 These system calls appeared on Linux starting with kernel 2.1.44.
31
32 The prototypes are given by glibc since version 2.3.2, provided
33 _GNU_SOURCE is defined.
34
36 These calls are nonstandard; they also appear on HP-UX and some of the
37 BSDs.
38
40 The original Linux getresuid() and getresgid() system calls supported
41 only 16-bit user and group IDs. Subsequently, Linux 2.4 added getre‐
42 suid32() and getresgid32(), supporting 32-bit IDs. The glibc getre‐
43 suid() and getresgid() wrapper functions transparently deal with the
44 variations across kernel versions.
45
47 getuid(2), setresuid(2), setreuid(2), setuid(2), credentials(7)
48
50 This page is part of release 5.02 of the Linux man-pages project. A
51 description of the project, information about reporting bugs, and the
52 latest version of this page, can be found at
53 https://www.kernel.org/doc/man-pages/.
54
55
56
57Linux 2017-09-15 GETRESUID(2)