~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
2 by Francesco Paolo Lovergine
* Alligned to linux main manpages edition.
2
.TH "SETEGID" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
3
.\" setegid 
4
.SH NAME
5
setegid \- set the effective group ID
6
.SH SYNOPSIS
7
.LP
8
\fB#include <unistd.h>
9
.br
10
.sp
11
int setegid(gid_t\fP \fIgid\fP\fB);
12
.br
13
\fP
14
.SH DESCRIPTION
15
.LP
16
If \fIgid\fP is equal to the real group ID or the saved set-group-ID,
17
or if the process has appropriate privileges,
18
\fIsetegid\fP() shall set the effective group ID of the calling process
19
to \fIgid\fP; the real group ID, saved set-group-ID, and
20
any supplementary group IDs shall remain unchanged.
21
.LP
22
The \fIsetegid\fP() function shall not affect the supplementary group
23
list in any way.
24
.SH RETURN VALUE
25
.LP
26
Upon successful completion, 0 shall be returned; otherwise, -1 shall
27
be returned and \fIerrno\fP set to indicate the error.
28
.SH ERRORS
29
.LP
30
The \fIsetegid\fP() function shall fail if:
31
.TP 7
32
.B EINVAL
33
The value of the \fIgid\fP argument is invalid and is not supported
34
by the implementation.
35
.TP 7
36
.B EPERM
37
The process does not have appropriate privileges and \fIgid\fP does
38
not match the real group ID or the saved
39
set-group-ID.
40
.sp
41
.LP
42
\fIThe following sections are informative.\fP
43
.SH EXAMPLES
44
.LP
45
None.
46
.SH APPLICATION USAGE
47
.LP
48
None.
49
.SH RATIONALE
50
.LP
51
Refer to the RATIONALE section in \fIsetuid\fP() .
52
.SH FUTURE DIRECTIONS
53
.LP
54
None.
55
.SH SEE ALSO
56
.LP
57
\fIexec\fP() , \fIgetegid\fP() , \fIgeteuid\fP() , \fIgetgid\fP()
58
, \fIgetuid\fP() ,
59
\fIseteuid\fP() , \fIsetgid\fP() , \fIsetregid\fP() , \fIsetreuid\fP()
60
, \fIsetuid\fP() ,
61
the Base Definitions volume of IEEE\ Std\ 1003.1-2001, \fI<sys/types.h>\fP,
62
\fI<unistd.h>\fP
63
.SH COPYRIGHT
64
Portions of this text are reprinted and reproduced in electronic form
65
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
66
-- Portable Operating System Interface (POSIX), The Open Group Base
67
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
68
Electrical and Electronics Engineers, Inc and The Open Group. In the
69
event of any discrepancy between this version and the original IEEE and
70
The Open Group Standard, the original IEEE and The Open Group Standard
71
is the referee document. The original Standard can be obtained online at
72
http://www.opengroup.org/unix/online.html .