1 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
2 .\" and Copyright (c) 2007, Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
28 .TH GETRESUID 2 2021-03-22 "Linux" "Linux Programmer's Manual"
30 getresuid, getresgid \- get real, effective, and saved user/group IDs
33 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
34 .B #include <unistd.h>
36 .BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid );
37 .BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid );
41 returns the real UID, the effective UID, and the saved set-user-ID
42 of the calling process, in the arguments
49 performs the analogous task for the process's group IDs.
51 On success, zero is returned.
52 On error, \-1 is returned, and
54 is set to indicate the error.
58 One of the arguments specified an address outside the calling program's
61 These system calls appeared on Linux starting with kernel 2.1.44.
63 The prototypes are given by glibc since version 2.3.2,
68 These calls are nonstandard;
69 they also appear on HP-UX and some of the BSDs.
75 system calls supported only 16-bit user and group IDs.
76 Subsequently, Linux 2.4 added
80 supporting 32-bit IDs.
85 wrapper functions transparently deal with the variations across kernel versions.