| 1 | .\" Copyright (c) 1983 Regents of the University of California. |
| 2 | .\" All rights reserved. The Berkeley software License Agreement |
| 3 | .\" specifies the terms and conditions for redistribution. |
| 4 | .\" |
| 5 | .\" @(#)Xsetregid.2 6.2 (Berkeley) %G% |
| 6 | .\" |
| 7 | .TH SETREGID 2 "" |
| 8 | .UC 5 |
| 9 | .SH NAME |
| 10 | setregid \- set real and effective group ID |
| 11 | .SH SYNOPSIS |
| 12 | .nf |
| 13 | .ft B |
| 14 | #include <sys/types.h> |
| 15 | .PP |
| 16 | .ft B |
| 17 | setregid(rgid, egid) |
| 18 | .br |
| 19 | gid_t rgid, egid; |
| 20 | .ft R |
| 21 | .SH DESCRIPTION |
| 22 | The real and effective group ID's of the current process |
| 23 | are set to the arguments. |
| 24 | Unprivileged users may change the real group |
| 25 | ID to the effective group ID and vice-versa; only the super-user may |
| 26 | make other changes. |
| 27 | .PP |
| 28 | Supplying a value of \-1 for either the real or effective |
| 29 | group ID forces the system to substitute the current |
| 30 | ID in place of the \-1 parameter. |
| 31 | .SH "RETURN VALUE |
| 32 | Upon successful completion, a value of 0 is returned. Otherwise, |
| 33 | a value of \-1 is returned and \fIerrno\fP is set to indicate the error. |
| 34 | .SH "ERRORS |
| 35 | .TP 15 |
| 36 | [EPERM] |
| 37 | The current process is not the super-user and a change |
| 38 | other than changing the effective group-id to the real group-id |
| 39 | was specified. |
| 40 | .SH "SEE ALSO" |
| 41 | getgid(2), setreuid(2), setgid(3) |