OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / getuid.2
1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2 .\"
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.
7 .\"
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.
12 .\"
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
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Historical remark, aeb, 2004-06-05
26 .TH GETUID 2 2010-11-22 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 getuid, geteuid \- get user identity
29 .SH SYNOPSIS
30 .B #include <unistd.h>
31 .br
32 .B #include <sys/types.h>
33 .sp
34 .B uid_t getuid(void);
35 .br
36 .B uid_t geteuid(void);
37 .SH DESCRIPTION
38 .BR getuid ()
39 returns the real user ID of the calling process.
40
41 .BR geteuid ()
42 returns the effective user ID of the calling process.
43 .SH ERRORS
44 These functions are always successful.
45 .SH CONFORMING TO
46 POSIX.1-2001, 4.3BSD.
47 .SH NOTES
48 .SS History
49 In UNIX\ V6 the
50 .BR getuid ()
51 call returned
52 .IR "(euid << 8) + uid" .
53 UNIX\ V7 introduced separate calls
54 .BR getuid ()
55 and
56 .BR geteuid ().
57
58 The original Linux
59 .BR getuid ()
60 and
61 .BR geteuid ()
62 system calls supported only 16-bit user IDs.
63 Subsequently, Linux 2.4 added
64 .BR getuid32 ()
65 and
66 .BR geteuid32 (),
67 supporting 32-bit IDs.
68 The glibc
69 .BR getuid ()
70 and
71 .BR geteuid ()
72 wrapper functions transparently deal with the variations across kernel versions.
73 .SH SEE ALSO
74 .BR getresuid (2),
75 .BR setreuid (2),
76 .BR setuid (2),
77 .BR credentials (7)
78 .SH COLOPHON
79 This page is part of release 3.79 of the Linux
80 .I man-pages
81 project.
82 A description of the project,
83 information about reporting bugs,
84 and the latest version of this page,
85 can be found at
86 \%http://www.kernel.org/doc/man\-pages/.