SETREGID(2)
NAME
setregid − set real and effective group ID
USAGE
setregid(rgid, egid) int rgid, egid;
DESCRIPTION
For the current process, setregid sets the real group ID to rgid and the effective group ID to egid. Only the super-user may change the real group ID of a process. Other users may only change the effective group ID to the real group ID.
If you supply a value of -1 for either rgid or egid, the system substitutes the current ID in place of the -1 parameter.
RETURN VALUE
A successful call returns zero. A failed call returns -1 and sets errno as indicated below.
ERRORS
[EPERM] The current process is not the super-user and a change other than changing the effective group-ID to the real group-ID was specified.