1SETEGID(3P)                POSIX Programmer's Manual               SETEGID(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       setegid — set the effective group ID
13

SYNOPSIS

15       #include <unistd.h>
16
17       int setegid(gid_t gid);
18

DESCRIPTION

20       If gid is equal to the real group ID or the saved set-group-ID,  or  if
21       the  process has appropriate privileges, setegid() shall set the effec‐
22       tive group ID of the calling process to gid; the real group  ID,  saved
23       set-group-ID, and any supplementary group IDs shall remain unchanged.
24
25       The setegid() function shall not affect the supplementary group list in
26       any way.
27

RETURN VALUE

29       Upon successful completion, 0 shall be returned; otherwise, -1 shall be
30       returned and errno set to indicate the error.
31

ERRORS

33       The setegid() function shall fail if:
34
35       EINVAL The value of the gid argument is invalid and is not supported by
36              the implementation.
37
38       EPERM  The process does not have appropriate privileges  and  gid  does
39              not match the real group ID or the saved set-group-ID.
40
41       The following sections are informative.
42

EXAMPLES

44       None.
45

APPLICATION USAGE

47       None.
48

RATIONALE

50       Refer to the RATIONALE section in setuid().
51

FUTURE DIRECTIONS

53       None.
54

SEE ALSO

56       exec,  getegid(),  geteuid(),  getgid(), getuid(), seteuid(), setgid(),
57       setregid(), setreuid(), setuid()
58
59       The Base Definitions volume of POSIX.1‐2017, <sys_types.h>, <unistd.h>
60
62       Portions of this text are reprinted and reproduced in  electronic  form
63       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
64       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
65       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
66       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
67       event of any discrepancy between this version and the original IEEE and
68       The Open Group Standard, the original IEEE and The Open Group  Standard
69       is  the  referee document. The original Standard can be obtained online
70       at http://www.opengroup.org/unix/online.html .
71
72       Any typographical or formatting errors that appear  in  this  page  are
73       most likely to have been introduced during the conversion of the source
74       files to man page format. To report such errors,  see  https://www.ker
75       nel.org/doc/man-pages/reporting_bugs.html .
76
77
78
79IEEE/The Open Group                  2017                          SETEGID(3P)
Impressum