1SETEGID(P) POSIX Programmer's Manual SETEGID(P)
2
3
4
6 setegid - set the effective group ID
7
9 #include <unistd.h>
10
11 int setegid(gid_t gid);
12
13
15 If gid is equal to the real group ID or the saved set-group-ID, or if
16 the process has appropriate privileges, setegid() shall set the effec‐
17 tive group ID of the calling process to gid; the real group ID, saved
18 set-group-ID, and any supplementary group IDs shall remain unchanged.
19
20 The setegid() function shall not affect the supplementary group list in
21 any way.
22
24 Upon successful completion, 0 shall be returned; otherwise, -1 shall be
25 returned and errno set to indicate the error.
26
28 The setegid() function shall fail if:
29
30 EINVAL The value of the gid argument is invalid and is not supported by
31 the implementation.
32
33 EPERM The process does not have appropriate privileges and gid does
34 not match the real group ID or the saved set-group-ID.
35
36
37 The following sections are informative.
38
40 None.
41
43 None.
44
46 Refer to the RATIONALE section in setuid() .
47
49 None.
50
52 exec() , getegid() , geteuid() , getgid() , getuid() , seteuid() , set‐
53 gid() , setregid() , setreuid() , setuid() , the Base Definitions vol‐
54 ume of IEEE Std 1003.1-2001, <sys/types.h>, <unistd.h>
55
57 Portions of this text are reprinted and reproduced in electronic form
58 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
59 -- Portable Operating System Interface (POSIX), The Open Group Base
60 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
61 Electrical and Electronics Engineers, Inc and The Open Group. In the
62 event of any discrepancy between this version and the original IEEE and
63 The Open Group Standard, the original IEEE and The Open Group Standard
64 is the referee document. The original Standard can be obtained online
65 at http://www.opengroup.org/unix/online.html .
66
67
68
69IEEE/The Open Group 2003 SETEGID(P)