setregid(2) DG/UX R4.11MU05 setregid(2)
NAME
setregid - set the real-, effective-, and saved-group-ids
SYNOPSIS
#include <sys/types.h>
int setregid (rgid, egid)
gidt rgid;
gidt egid;
where:
rgid The value to which the real-group-id should be set
egid The value to which the effective-group-id should be set
DESCRIPTION
The real-group-id and effective-group-id's of the calling process are
set according to the arguments. If rgid or egid is -1, the current
value of the real-group-id or effective-group-id is used. If the
caller does not have appropriate privilege, he may only set the
effective-group-id to the real-group-id or the saved-group-id. Only
a user with appropriate privilege may make other changes. If after
changing the real- and effective-group-id's, the calling process's
effective-group-id no longer matches either its real- or
saved-group-id's, its saved-group-id is set to the value of its
effective-group-id.
Note that changing the real-group-id or effective-group-id does not
alter any supplementary group-ids of the calling process.
ACCESS CONTROL
If the the calling process has appropriate privilege, setting of the
real- and effective-group-ids is not restricted.
Otherwise, the effective-group-id may be set only to its current
value or to the current value of the real-user-id or to the
saved-group-id value. The real-group-id may be set only to its
current value.
For systems supporting the DG/UX Capability Option, appropriate
privilege is defined as having one or more specific capabilities
enabled in the effective capability set of the calling process. See
capdefaults(5) for the default capability for this system call.
On systems without the DG/UX Capability Option, appropriate privilege
means that the process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
RETURN VALUE
0 Successful completion.
-1 An error occurred. errno is set to indicate the error.
DIAGNOSTICS
Errno may be set to one of the following error codes:
EPERM The above specified access check failed.
EINVAL The supplied value of rgid or egid was less than -1 or
greater than MAXUID.
SEE ALSO
getuid(2), geteuid(2), getgid(2), getegid(2), setuid(2), setgid(2),
setreuid(2), appropriateprivilege(5).
capdefaults(5).
Licensed material--property of copyright holder(s)