Commit | Line | Data |
---|---|---|
42a92ee6 KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
345fe298 | 5 | .\" @(#)getuid.2 6.3 (Berkeley) %G% |
42a92ee6 | 6 | .\" |
9c9177ce | 7 | .TH GETUID 2 "" |
42a92ee6 KM |
8 | .UC 4 |
9 | .SH NAME | |
6db89aec | 10 | getuid, geteuid \- get user identity |
42a92ee6 | 11 | .SH SYNOPSIS |
345fe298 KM |
12 | .nf |
13 | .ft B | |
14 | #include <sys/types.h> | |
15 | .PP | |
6db89aec KM |
16 | .ft B |
17 | .nf | |
18 | uid = getuid() | |
345fe298 | 19 | uid_t uid; |
42a92ee6 | 20 | .PP |
6db89aec KM |
21 | .ft B |
22 | euid = geteuid() | |
345fe298 | 23 | uid_t euid; |
6db89aec | 24 | .fi |
42a92ee6 KM |
25 | .SH DESCRIPTION |
26 | .I Getuid | |
27 | returns the real user ID of the current process, | |
28 | .I geteuid | |
29 | the effective user ID. | |
42a92ee6 | 30 | .PP |
6db89aec KM |
31 | The real user ID identifies the person who is logged in. |
32 | The effective user ID | |
33 | gives the process additional permissions during | |
34 | execution of \*(lqset-user-ID\*(rq mode processes, which use | |
63b0bb9c | 35 | \fIgetuid\fP to determine the real-user-id of the process that |
6db89aec | 36 | invoked them. |
42a92ee6 | 37 | .SH "SEE ALSO" |
6db89aec | 38 | getgid(2), setreuid(2) |