]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/getresuid.2
_exit.2, access.2, acct.2, adjtimex.2, alarm.2, alloc_hugepages.2, arch_prctl.2,...
[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 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
25 .TH GETRESUID 2 2010-11-22 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 getresuid, getresgid \- get real, effective and saved user/group IDs
28 .SH SYNOPSIS
29 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
30 .br
31 .B #include <unistd.h>
32 .sp
33 .BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid );
34 .br
35 .BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid );
36 .SH DESCRIPTION
37 .BR getresuid ()
38 returns the real UID, the effective UID, and the saved set-user-ID
39 of the calling process, in the arguments
40 .IR ruid ,
41 .IR euid ,
42 and
43 .IR suid ,
44 respectively.
45 .BR getresgid ()
46 performs the analogous task for the process's group IDs.
47 .SH RETURN VALUE
48 On success, zero is returned.
49 On error, \-1 is returned, and
50 .I errno
51 is set appropriately.
52 .SH ERRORS
53 .TP
54 .B EFAULT
55 One of the arguments specified an address outside the calling program's
56 address space.
57 .SH VERSIONS
58 These system calls appeared on Linux starting with kernel 2.1.44.
59
60 The prototypes are given by glibc since version 2.3.2,
61 provided
62 .B _GNU_SOURCE
63 is defined.
64 .SH CONFORMING TO
65 These calls are nonstandard;
66 they also appear on HP-UX and some of the BSDs.
67 .SH NOTES
68 The original Linux
69 .BR getresuid ()
70 and
71 .BR getresgid ()
72 system calls supported only 16-bit user and group IDs.
73 Subsequently, Linux 2.4 added
74 .BR getresuid32 ()
75 and
76 .BR getresgid32 (),
77 supporting 32-bit IDs.
78 The glibc
79 .BR getresuid ()
80 and
81 .BR getresgid ()
82 wrapper functions transparently deal with the variations across kernel versions.
83 .SH SEE ALSO
84 .BR getuid (2),
85 .BR setresuid (2),
86 .BR setreuid (2),
87 .BR setuid (2),
88 .BR credentials (7)