1GETUID(P) POSIX Programmer's Manual GETUID(P)
2
3
4
6 getuid - get a real user ID
7
9 #include <unistd.h>
10
11 uid_t getuid(void);
12
13
15 The getuid() function shall return the real user ID of the calling
16 process.
17
19 The getuid() function shall always be successful and no return value is
20 reserved to indicate the error.
21
23 No errors are defined.
24
25 The following sections are informative.
26
28 Setting the Effective User ID to the Real User ID
29 The following example sets the effective user ID and the real user ID
30 of the current process to the real user ID of the caller.
31
32
33 #include <unistd.h>
34 #include <sys/types.h>
35 ...
36 setreuid(getuid(), getuid());
37 ...
38
40 None.
41
43 None.
44
46 None.
47
49 getegid() , geteuid() , getgid() , setegid() , seteuid() , setgid() ,
50 setregid() , setreuid() , setuid() , the Base Definitions volume of
51 IEEE Std 1003.1-2001, <sys/types.h>, <unistd.h>
52
54 Portions of this text are reprinted and reproduced in electronic form
55 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
56 -- Portable Operating System Interface (POSIX), The Open Group Base
57 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
58 Electrical and Electronics Engineers, Inc and The Open Group. In the
59 event of any discrepancy between this version and the original IEEE and
60 The Open Group Standard, the original IEEE and The Open Group Standard
61 is the referee document. The original Standard can be obtained online
62 at http://www.opengroup.org/unix/online.html .
63
64
65
66IEEE/The Open Group 2003 GETUID(P)