setregid(2)
NAME
setregid − set real and effective group IDs
SYNTAX
int setregid(rgid, egid)
int rgid, egid;
DESCRIPTION
The setregid system call sets the real and effective group IDs of the current process to rgid and egid. If either rgid or egid is a −1, the appropriate gid is filled in by the system.
RESTRICTIONS
Only the superuser may change the real group ID of a process. Users other than the superuser may change the effective group ID of the process only to the real group ID.
RETURN VALUE
If unsuccessful, returns a −1, and the global variable errno indicates the error code.
DIAGNOSTICS
The setregid call will fail if:
[EPERM] The current process is not the superuser, and a change other than changing the effective group ID to the real group ID was specified.