]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/getresuid.2
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man2 / getresuid.2
CommitLineData
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 10getresuid, getresgid \- get real, effective, and saved user/group IDs
b07931ad
AC
11.SH LIBRARY
12Standard 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
24returns the real UID, the effective UID, and the saved set-user-ID
25of the calling process, in the arguments
26.IR ruid ,
27.IR euid ,
fea681da 28and
5a3dd911
MK
29.IR suid ,
30respectively.
e511ffb6 31.BR getresgid ()
5a3dd911 32performs the analogous task for the process's group IDs.
47297adb 33.SH RETURN VALUE
c13182ef
MK
34On success, zero is returned.
35On error, \-1 is returned, and
fea681da 36.I errno
f6a4078b 37is set to indicate the error.
fea681da
MK
38.SH ERRORS
39.TP
40.B EFAULT
41One of the arguments specified an address outside the calling program's
42address space.
5a3dd911
MK
43.SH VERSIONS
44These system calls appeared on Linux starting with kernel 2.1.44.
efeece04 45.PP
5a3dd911 46The prototypes are given by glibc since version 2.3.2,
682edefb
MK
47provided
48.B _GNU_SOURCE
49is defined.
3113c7f3 50.SH STANDARDS
c8f2dd47 51These calls are nonstandard;
5a3dd911 52they also appear on HP-UX and some of the BSDs.
62eaf126
MK
53.SH NOTES
54The original Linux
55.BR getresuid ()
56and
57.BR getresgid ()
58system calls supported only 16-bit user and group IDs.
c5662d5d 59Subsequently, Linux 2.4 added
62eaf126
MK
60.BR getresuid32 ()
61and
62.BR getresgid32 (),
63supporting 32-bit IDs.
64The glibc
65.BR getresuid ()
66and
67.BR getresgid ()
68wrapper 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)