]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/getuid.2
dist.mk, All pages: .TH: Generate date at 'make dist'
[thirdparty/man-pages.git] / man2 / getuid.2
CommitLineData
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
8getuid, geteuid \- get user identity
d1c2f5d3
AC
9.SH LIBRARY
10Standard 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 21returns the real user ID of the calling process.
efeece04 22.PP
e511ffb6 23.BR geteuid ()
a1ffe9f5 24returns the effective user ID of the calling process.
fea681da 25.SH ERRORS
b926779b
MK
26These functions are always successful
27and 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 32POSIX.1-2001, POSIX.1-2008, 4.3BSD.
889829be
MK
33.SH NOTES
34.SS History
b4112efb 35In UNIX\ V6 the
60a90ecd 36.BR getuid ()
4f9f83f0
MK
37call returned
38.IR "(euid << 8) + uid" .
b4112efb 39UNIX\ V7 introduced separate calls
60a90ecd
MK
40.BR getuid ()
41and
42.BR geteuid ().
efeece04 43.PP
80978cba
MK
44The original Linux
45.BR getuid ()
46and
47.BR geteuid ()
48system calls supported only 16-bit user IDs.
c5662d5d 49Subsequently, Linux 2.4 added
80978cba
MK
50.BR getuid32 ()
51and
52.BR geteuid32 (),
53supporting 32-bit IDs.
54The glibc
55.BR getuid ()
56and
57.BR geteuid ()
58wrapper functions transparently deal with the variations across kernel versions.
70ea1968 59.PP
03936fb4 60On Alpha, instead of a pair of
b30b425b
MK
61.BR getuid ()
62and
63.BR geteuid ()
03936fb4 64system calls, a single
70ea1968
ES
65.BR getxuid ()
66system call is provided, which returns a pair of real and effective UIDs.
67The glibc
68.BR getuid ()
69and
70.BR geteuid ()
71wrapper functions transparently deal with this.
72See
73.BR syscall (2)
74for 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)