OSDN Git Service

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