Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setgid(2) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getuid(2)

setregid(2)

setreuid(2)

intro(2)




setuid(2) setuid(2)
NAME setuid, setgid - set user and group ID SYNOPSIS #include <sys/types.h> uid_t setuid(uid) uid_t uid; int setgid(gid) gid_t gid; DESCRIPTION setuid sets the real user ID, effective user ID, and saved set-user-ID of the calling process. If the effective user ID of the calling process is superuser, the real user ID, effective user ID, and saved set-user-ID are set to uid. If the effective user ID of the calling process is not the su- peruser, but its real user ID is equal to uid, the effective user ID is set to uid. If the effective user ID of the calling process is not the superuser, but the saved set-user-ID from exec(2) is equal to uid, the effective user ID is set to uid. setgid sets the real group ID, effective group ID, and saved set-group-ID of the calling process. If the effective user ID of the calling process is the su- peruser, the real group ID, effective group ID, and saved set-group-ID are set to gid. If the effective user ID of the calling process is not the superuser, but its real group ID is equal to gid, the effec- tive group ID is set to gid. If the effective user ID of the calling process is not the superuser, but the saved set-group-ID from exec(2) is equal to gid, the effective group ID is set to gid. RETURN VALUE On successful completion, a value of 0 is returned. Other- wise, a value of -1 is returned and errno is set to indicate the error. ERRORS setuid or setgid will fail if one or more of the following are true: [EPERM] The real user or group ID of the calling process is not equal to uid or gid and its effective user ID is not the superuser. April, 1990 1



setuid(2) setuid(2)
[EINVAL] uid is out of range. SEE ALSO getuid(2), setregid(2), setreuid(2), intro(2). 2 April, 1990

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026