BSD 4_2 development
[unix-history] / usr / man / man2 / setregid.2
CommitLineData
9814591b
C
1.TH SETREGID 2 "12 February 1983"
2.UC 4
3.SH NAME
4setregid \- set real and effective group ID
5.SH SYNOPSIS
6.ft B
7setregid(rgid, egid)
8.br
9int rgid, egid;
10.ft R
11.SH DESCRIPTION
12The real and effective group ID's of the current process
13are set to the arguments.
14Only the super-user may change the real group ID
15of a process. Unpriviledged users may change the
16effective group ID to the real group ID, but to
17no other.
18.PP
19Supplying a value of \-1 for either the real or effective
20group ID forces the system to substitute the current
21ID in place of the \-1 parameter.
22.SH "RETURN VALUE
23Upon successful completion, a value of 0 is returned. Otherwise,
24a value of \-1 is returned and \fIerrno\fP is set to indicate the error.
25.SH "ERRORS
26.TP 15
27[EPERM]
28The current process is not the super-user and a change
29other than changing the effective group-id to the real group-id
30was specified.
31.SH "SEE ALSO"
32getgid(2), setreuid(2), setgid(3)