1getuid(2)                     System Calls Manual                    getuid(2)
2
3
4

NAME

6       getuid, geteuid - get user identity
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <unistd.h>
13
14       uid_t getuid(void);
15       uid_t geteuid(void);
16

DESCRIPTION

18       getuid() returns the real user ID of the calling process.
19
20       geteuid() returns the effective user ID of the calling process.
21

ERRORS

23       These functions are always successful and never modify errno.
24

STANDARDS

26       POSIX.1-2008.
27

HISTORY

29       POSIX.1-2001, 4.3BSD.
30
31       In  UNIX V6  the getuid() call returned (euid << 8) + uid.  UNIX V7 in‐
32       troduced separate calls getuid() and geteuid().
33
34       The original Linux getuid() and geteuid() system calls  supported  only
35       16-bit  user  IDs.   Subsequently,  Linux  2.4 added getuid32() and ge‐
36       teuid32(), supporting 32-bit IDs.  The  glibc  getuid()  and  geteuid()
37       wrapper  functions transparently deal with the variations across kernel
38       versions.
39
40       On Alpha, instead of a pair of getuid() and geteuid() system  calls,  a
41       single  getxuid() system call is provided, which returns a pair of real
42       and effective UIDs.  The glibc getuid() and geteuid() wrapper functions
43       transparently  deal  with  this.   See syscall(2) for details regarding
44       register mapping.
45

SEE ALSO

47       getresuid(2), setreuid(2), setuid(2), credentials(7)
48
49
50
51Linux man-pages 6.04              2023-03-30                         getuid(2)
Impressum