]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
4 | .\" |
5 | .\" Historical remark, aeb, 2004-06-05 | |
ab47278f | 6 | .TH GETUID 2 (date) "Linux man-pages (unreleased)" |
fea681da MK |
7 | .SH NAME |
8 | getuid, geteuid \- get user identity | |
d1c2f5d3 AC |
9 | .SH LIBRARY |
10 | Standard C library | |
8fc3b2cf | 11 | .RI ( libc ", " \-lc ) |
fea681da | 12 | .SH SYNOPSIS |
c7db92b9 | 13 | .nf |
fea681da | 14 | .B #include <unistd.h> |
68e4db0a | 15 | .PP |
fea681da | 16 | .B uid_t getuid(void); |
fea681da | 17 | .B uid_t geteuid(void); |
c7db92b9 | 18 | .fi |
fea681da | 19 | .SH DESCRIPTION |
e511ffb6 | 20 | .BR getuid () |
a1ffe9f5 | 21 | returns the real user ID of the calling process. |
efeece04 | 22 | .PP |
e511ffb6 | 23 | .BR geteuid () |
a1ffe9f5 | 24 | returns the effective user ID of the calling process. |
fea681da | 25 | .SH ERRORS |
b926779b MK |
26 | These functions are always successful |
27 | and never modify | |
28 | .\" https://www.austingroupbugs.net/view.php?id=511 | |
29 | .\" 0000511: getuid and friends should not modify errno | |
30 | .IR errno . | |
3113c7f3 | 31 | .SH STANDARDS |
03e52a0a | 32 | POSIX.1-2001, POSIX.1-2008, 4.3BSD. |
889829be MK |
33 | .SH NOTES |
34 | .SS History | |
b4112efb | 35 | In UNIX\ V6 the |
60a90ecd | 36 | .BR getuid () |
4f9f83f0 MK |
37 | call returned |
38 | .IR "(euid << 8) + uid" . | |
b4112efb | 39 | UNIX\ V7 introduced separate calls |
60a90ecd MK |
40 | .BR getuid () |
41 | and | |
42 | .BR geteuid (). | |
efeece04 | 43 | .PP |
80978cba MK |
44 | The original Linux |
45 | .BR getuid () | |
46 | and | |
47 | .BR geteuid () | |
48 | system calls supported only 16-bit user IDs. | |
c5662d5d | 49 | Subsequently, Linux 2.4 added |
80978cba MK |
50 | .BR getuid32 () |
51 | and | |
52 | .BR geteuid32 (), | |
53 | supporting 32-bit IDs. | |
54 | The glibc | |
55 | .BR getuid () | |
56 | and | |
57 | .BR geteuid () | |
58 | wrapper functions transparently deal with the variations across kernel versions. | |
70ea1968 | 59 | .PP |
03936fb4 | 60 | On Alpha, instead of a pair of |
b30b425b MK |
61 | .BR getuid () |
62 | and | |
63 | .BR geteuid () | |
03936fb4 | 64 | system calls, a single |
70ea1968 ES |
65 | .BR getxuid () |
66 | system call is provided, which returns a pair of real and effective UIDs. | |
67 | The glibc | |
68 | .BR getuid () | |
69 | and | |
70 | .BR geteuid () | |
71 | wrapper functions transparently deal with this. | |
72 | See | |
73 | .BR syscall (2) | |
74 | for details regarding register mapping. | |
47297adb | 75 | .SH SEE ALSO |
520b53c6 | 76 | .BR getresuid (2), |
fea681da | 77 | .BR setreuid (2), |
520b53c6 MK |
78 | .BR setuid (2), |
79 | .BR credentials (7) |