SETUID(2-SVR3) RISC/os Reference Manual SETUID(2-SVR3)
NAME
setuid, setgid - set user and group IDs
SYNOPSIS
int setuid (uid)
int uid;
int setgid (gid)
int gid;
DESCRIPTION
setuid (setgid) is used to set the real user (group) ID and
effective user (group) ID of the calling process. Also set
is the saved set-user (group) ID from exec(2).
If the effective user ID of the calling process is super-
user, the real user (group) ID, effective user (group) ID,
and saved set-user (group) ID are set to uid (gid).
If the effective user ID of the calling process is not
super-user, but its real user (group) ID is equal to uid
(gid), the effective user (group) ID is set to uid (gid).
If the effective user ID of the calling process is not
super-user, but the saved set-user (group) ID from exec(2)
is equal to uid (gid), the effective user (group) ID is set
to uid (gid).
setuid (setgid) will fail if the effective user ID is not
super-user and uid (gid) is not equal to either the real
user (group) or saved set-user (group) ID. [EPERM]
The uid is out of range. [EINVAL]
SEE ALSO
getuid(2), intro(2).
DIAGNOSTICS
Upon successful completion, a value of 0 is returned. Oth-
erwise, a value of -1 is returned and errno is set to indi-
cate the error.
Printed 11/19/92 Page 1