]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/getresuid.2
Many pages: Use STANDARDS instead of CONFORMING TO
[thirdparty/man-pages.git] / man2 / getresuid.2
1 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
2 .\" and Copyright (c) 2007, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
7 .\"
8 .TH GETRESUID 2 2021-03-22 "Linux" "Linux Programmer's Manual"
9 .SH NAME
10 getresuid, getresgid \- get real, effective, and saved user/group IDs
11 .SH LIBRARY
12 Standard C library
13 .RI ( libc ", " \-lc )
14 .SH SYNOPSIS
15 .nf
16 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
17 .B #include <unistd.h>
18 .PP
19 .BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid );
20 .BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid );
21 .fi
22 .SH DESCRIPTION
23 .BR getresuid ()
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 ,
28 and
29 .IR suid ,
30 respectively.
31 .BR getresgid ()
32 performs the analogous task for the process's group IDs.
33 .SH RETURN VALUE
34 On success, zero is returned.
35 On error, \-1 is returned, and
36 .I errno
37 is set to indicate the error.
38 .SH ERRORS
39 .TP
40 .B EFAULT
41 One of the arguments specified an address outside the calling program's
42 address space.
43 .SH VERSIONS
44 These system calls appeared on Linux starting with kernel 2.1.44.
45 .PP
46 The prototypes are given by glibc since version 2.3.2,
47 provided
48 .B _GNU_SOURCE
49 is defined.
50 .SH STANDARDS
51 These calls are nonstandard;
52 they also appear on HP-UX and some of the BSDs.
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.
59 Subsequently, Linux 2.4 added
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.
69 .SH SEE ALSO
70 .BR getuid (2),
71 .BR setresuid (2),
72 .BR setreuid (2),
73 .BR setuid (2),
74 .BR credentials (7)