1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Historical remark, aeb, 2004-06-05
26 .TH GETUID 2 2019-03-06 "Linux" "Linux Programmer's Manual"
28 getuid, geteuid \- get user identity
30 .B #include <unistd.h>
32 .B #include <sys/types.h>
34 .B uid_t getuid(void);
36 .B uid_t geteuid(void);
39 returns the real user ID of the calling process.
42 returns the effective user ID of the calling process.
44 These functions are always successful.
46 POSIX.1-2001, POSIX.1-2008, 4.3BSD.
52 .IR "(euid << 8) + uid" .
53 UNIX\ V7 introduced separate calls
62 system calls supported only 16-bit user IDs.
63 Subsequently, Linux 2.4 added
67 supporting 32-bit IDs.
72 wrapper functions transparently deal with the variations across kernel versions.
74 On Alpha, instead of a pair of
78 system calls, a single
80 system call is provided, which returns a pair of real and effective UIDs.
85 wrapper functions transparently deal with this.
88 for details regarding register mapping.