1 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
2 .\" and Copyright (c) 2007, Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
25 .TH GETRESUID 2 2010-11-22 "Linux" "Linux Programmer's Manual"
27 getresuid, getresgid \- get real, effective and saved user/group IDs
29 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
31 .B #include <unistd.h>
33 .BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid );
35 .BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid );
38 returns the real UID, the effective UID, and the saved set-user-ID
39 of the calling process, in the arguments
46 performs the analogous task for the process's group IDs.
48 On success, zero is returned.
49 On error, \-1 is returned, and
55 One of the arguments specified an address outside the calling program's
58 These system calls appeared on Linux starting with kernel 2.1.44.
60 The prototypes are given by glibc since version 2.3.2,
65 These calls are nonstandard;
66 they also appear on HP-UX and some of the BSDs.
72 system calls supported only 16-bit user and group IDs.
73 Subsequently, Linux 2.4 added
77 supporting 32-bit IDs.
82 wrapper functions transparently deal with the variations across kernel versions.