setregid(2) — System Calls
OSF
NAME
setregid − Sets the real and effective group ID
SYNOPSIS
setregid(
int rgid,
int egid );
PARAMETERS
rgidSpecifies the new real group ID.
egidSpecifies the new effective group ID.
DESCRIPTION
The setregid() function sets the real group ID of the current process to the value specified by the rgid parameter, and sets the effective group ID to the value specified by the egid parameter.
Unprivileged users may change the effective group ID to the real group ID; only the superuser may make other changes.
Supplying a value of −1 for either the real or effective group ID forces the system to substitute the current ID in place of the −1 parameter.
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Otherwise, a value of −1 is returned and errno is set to indicate the error.
ERRORS
If the setregid() function fails, errno may be set to the following value:
[EPERM]The current process does not have superuser privilege and a change other than changing the effective group ID to the real group ID was specified.
RELATED INFORMATION
Functions: getgid(2), setgid(2), setrgid(3), setreuid(2)