OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / 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 .\" %%%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.
8 .\"
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.
13 .\"
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
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
27 .\"
28 .TH GETRESUID 2 2010-11-22 "Linux" "Linux Programmer's Manual"
29 .SH NAME
30 getresuid, getresgid \- get real, effective and saved user/group IDs
31 .SH SYNOPSIS
32 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
33 .br
34 .B #include <unistd.h>
35 .sp
36 .BI "int getresuid(uid_t *" ruid ", uid_t *" euid ", uid_t *" suid );
37 .br
38 .BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid );
39 .SH DESCRIPTION
40 .BR getresuid ()
41 returns the real UID, the effective UID, and the saved set-user-ID
42 of the calling process, in the arguments
43 .IR ruid ,
44 .IR euid ,
45 and
46 .IR suid ,
47 respectively.
48 .BR getresgid ()
49 performs the analogous task for the process's group IDs.
50 .SH RETURN VALUE
51 On success, zero is returned.
52 On error, \-1 is returned, and
53 .I errno
54 is set appropriately.
55 .SH ERRORS
56 .TP
57 .B EFAULT
58 One of the arguments specified an address outside the calling program's
59 address space.
60 .SH VERSIONS
61 These system calls appeared on Linux starting with kernel 2.1.44.
62
63 The prototypes are given by glibc since version 2.3.2,
64 provided
65 .B _GNU_SOURCE
66 is defined.
67 .SH CONFORMING TO
68 These calls are nonstandard;
69 they also appear on HP-UX and some of the BSDs.
70 .SH NOTES
71 The original Linux
72 .BR getresuid ()
73 and
74 .BR getresgid ()
75 system calls supported only 16-bit user and group IDs.
76 Subsequently, Linux 2.4 added
77 .BR getresuid32 ()
78 and
79 .BR getresgid32 (),
80 supporting 32-bit IDs.
81 The glibc
82 .BR getresuid ()
83 and
84 .BR getresgid ()
85 wrapper functions transparently deal with the variations across kernel versions.
86 .SH SEE ALSO
87 .BR getuid (2),
88 .BR setresuid (2),
89 .BR setreuid (2),
90 .BR setuid (2),
91 .BR credentials (7)
92 .SH COLOPHON
93 This page is part of release 3.79 of the Linux
94 .I man-pages
95 project.
96 A description of the project,
97 information about reporting bugs,
98 and the latest version of this page,
99 can be found at
100 \%http://www.kernel.org/doc/man\-pages/.