1 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
2 .\" and Copyright (c) 2007, Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
8 .TH getresuid 2 (date) "Linux man-pages (unreleased)"
10 getresuid, getresgid \- get real, effective, and saved user/group IDs
13 .RI ( libc ", " \-lc )
16 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
17 .B #include <unistd.h>
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 );
24 returns the real UID, the effective UID, and the saved set-user-ID
25 of the calling process, in the arguments
32 performs the analogous task for the process's group IDs.
34 On success, zero is returned.
35 On error, \-1 is returned, and
37 is set to indicate the error.
41 One of the arguments specified an address outside the calling program's
45 These calls also appear on HP-UX and some of the BSDs.
54 system calls supported only 16-bit user and group IDs.
55 Subsequently, Linux 2.4 added
59 supporting 32-bit IDs.
64 wrapper functions transparently deal with the variations across kernel versions.