Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

setregid(2) OSS System Calls Reference Manual
NAME
setregid - Sets the real and effective group IDs
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsecsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zsecdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ysecdll
SYNOPSIS
#include <unistd.h>
int setregid(
gid_t rgid,
gid_t egid );
PARAMETERS
rgid Specifies the new real group ID.
egid Specifies the new effective group ID.
DESCRIPTION
The setregid() function sets the real group ID and the effective group ID of the current process
to the values specified by the rgid and egid parameters, respectively.
A process with appropriate privileges can set either group ID to any value.
A process without appropriate privileges can:
Set the real group ID to the saved-set group ID used with an execv() function call
Set the effective group ID to the saved-set group ID used with an execv() function call
Set the effective group ID to the real group ID
Supplementary group IDs remain unchanged after a call to this function.
Supplying a value of -1 for either the real or effective group ID forces the system to substitute the
current group ID in place of the -1 value.
NOTES
The setregid() function can be called only by native processes.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned
and errno is set to indicate the error.
ERRORS
If any of the following conditions occur, the setregid() function sets errno to the corresponding
value:
[EINVAL] The value of the rgid or egid parameter is invalid or out of range.
[EPERM] The calling process does not have appropriate privileges and a change requiring
appropriate privileges was specified.
RELATED INFORMATION
Functions: execv(2), getgid(2), setgid(2).
764 Hewlett-Packard Company 527186-023