]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl) |
5a3dd911 | 2 | .\" and Copyright (c) 2007, Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 3 | .\" |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da | 5 | .\" |
c11b1abf | 6 | .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com> |
4784c377 | 7 | .\" |
4c1c5274 | 8 | .TH getresuid 2 (date) "Linux man-pages (unreleased)" |
fea681da | 9 | .SH NAME |
735334d4 | 10 | getresuid, getresgid \- get real, effective, and saved user/group IDs |
b07931ad AC |
11 | .SH LIBRARY |
12 | Standard C library | |
8fc3b2cf | 13 | .RI ( libc ", " \-lc ) |
fea681da | 14 | .SH SYNOPSIS |
c7db92b9 | 15 | .nf |
b80f966b | 16 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
fea681da | 17 | .B #include <unistd.h> |
68e4db0a | 18 | .PP |
fea681da | 19 | .BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid ); |
c13182ef | 20 | .BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid ); |
c7db92b9 | 21 | .fi |
fea681da | 22 | .SH DESCRIPTION |
e511ffb6 | 23 | .BR getresuid () |
5a3dd911 MK |
24 | returns the real UID, the effective UID, and the saved set-user-ID |
25 | of the calling process, in the arguments | |
26 | .IR ruid , | |
27 | .IR euid , | |
fea681da | 28 | and |
5a3dd911 MK |
29 | .IR suid , |
30 | respectively. | |
e511ffb6 | 31 | .BR getresgid () |
5a3dd911 | 32 | performs the analogous task for the process's group IDs. |
47297adb | 33 | .SH RETURN VALUE |
c13182ef MK |
34 | On success, zero is returned. |
35 | On error, \-1 is returned, and | |
fea681da | 36 | .I errno |
f6a4078b | 37 | is set to indicate the error. |
fea681da MK |
38 | .SH ERRORS |
39 | .TP | |
40 | .B EFAULT | |
41 | One of the arguments specified an address outside the calling program's | |
42 | address space. | |
5a3dd911 MK |
43 | .SH VERSIONS |
44 | These system calls appeared on Linux starting with kernel 2.1.44. | |
efeece04 | 45 | .PP |
5a3dd911 | 46 | The prototypes are given by glibc since version 2.3.2, |
682edefb MK |
47 | provided |
48 | .B _GNU_SOURCE | |
49 | is defined. | |
3113c7f3 | 50 | .SH STANDARDS |
c8f2dd47 | 51 | These calls are nonstandard; |
5a3dd911 | 52 | they also appear on HP-UX and some of the BSDs. |
62eaf126 MK |
53 | .SH NOTES |
54 | The original Linux | |
55 | .BR getresuid () | |
56 | and | |
57 | .BR getresgid () | |
58 | system calls supported only 16-bit user and group IDs. | |
c5662d5d | 59 | Subsequently, Linux 2.4 added |
62eaf126 MK |
60 | .BR getresuid32 () |
61 | and | |
62 | .BR getresgid32 (), | |
63 | supporting 32-bit IDs. | |
64 | The glibc | |
65 | .BR getresuid () | |
66 | and | |
67 | .BR getresgid () | |
68 | wrapper functions transparently deal with the variations across kernel versions. | |
47297adb | 69 | .SH SEE ALSO |
fea681da MK |
70 | .BR getuid (2), |
71 | .BR setresuid (2), | |
72 | .BR setreuid (2), | |
0a90178c | 73 | .BR setuid (2), |
0a4f8b7b | 74 | .BR credentials (7) |