Commit | Line | Data |
---|---|---|
931b8415 CL |
1 | .\" Copyright (c) 1980, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
42a92ee6 | 3 | .\" |
931b8415 | 4 | .\" %sccs.include.redist.man% |
42a92ee6 | 5 | .\" |
931b8415 CL |
6 | .\" @(#)getuid.2 6.4 (Berkeley) %G% |
7 | .\" | |
8 | .Dd | |
9 | .Dt GETUID 2 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm getuid , | |
13 | .Nm geteuid | |
14 | .Nd get user identification | |
15 | .Sh SYNOPSIS | |
16 | .Fd #include <unistd.h> | |
17 | .Fd #include <sys/types.h> | |
18 | .Ft uid_t | |
19 | .Fn getuid void | |
20 | .Ft uid_t | |
21 | .Fn geteuid void | |
22 | .Sh DESCRIPTION | |
23 | The | |
24 | .Fn getuid | |
25 | function returns the real user ID of the calling process. | |
26 | The | |
27 | .Fn geteuid | |
28 | function | |
29 | returns the effective user ID of the calling process. | |
30 | .Pp | |
31 | The real user ID is that of the user who has invoked the program. | |
32 | As the effective user ID | |
6db89aec | 33 | gives the process additional permissions during |
931b8415 CL |
34 | execution of |
35 | .Dq Em set-user-ID | |
36 | mode processes, | |
37 | .Fn getuid | |
38 | is used to determine the real-user-id of the calling process. | |
39 | .Sh ERRORS | |
40 | The | |
41 | .Fn getuid | |
42 | and | |
43 | .Fn geteuid | |
44 | functions are always successful, and no return value is reserved to | |
45 | indicate an error. | |
46 | .Sh SEE ALSO | |
47 | .Xr getgid 2 , | |
48 | .Xr setreuid 2 | |
49 | .Sh STANDARDS | |
50 | .Fn Geteuid | |
51 | and | |
52 | .Fn getuid | |
53 | conform to IEEE Std 1003.1-1988 | |
54 | .Pq Dq Tn POSIX . |