1GETUID(2) Linux Programmer's Manual GETUID(2)
2
3
4
6 getuid, geteuid - get user identity
7
9 #include <unistd.h>
10 #include <sys/types.h>
11
12 uid_t getuid(void);
13 uid_t geteuid(void);
14
16 getuid() returns the real user ID of the calling process.
17
18 geteuid() returns the effective user ID of the calling process.
19
21 These functions are always successful.
22
24 POSIX.1-2001, POSIX.1-2008, 4.3BSD.
25
27 History
28 In UNIX V6 the getuid() call returned (euid << 8) + uid. UNIX V7
29 introduced separate calls getuid() and geteuid().
30
31 The original Linux getuid() and geteuid() system calls supported only
32 16-bit user IDs. Subsequently, Linux 2.4 added getuid32() and
33 geteuid32(), supporting 32-bit IDs. The glibc getuid() and geteuid()
34 wrapper functions transparently deal with the variations across kernel
35 versions.
36
37 On Alpha, instead of a pair of getuid() and geteuid() system calls, a
38 single getxuid() system call is provided, which returns a pair of real
39 and effective UIDs. The glibc getuid() and geteuid() wrapper functions
40 transparently deal with this. See syscall(2) for details regarding
41 register mapping.
42
44 getresuid(2), setreuid(2), setuid(2), credentials(7)
45
47 This page is part of release 5.04 of the Linux man-pages project. A
48 description of the project, information about reporting bugs, and the
49 latest version of this page, can be found at
50 https://www.kernel.org/doc/man-pages/.
51
52
53
54Linux 2019-03-06 GETUID(2)