Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setuid(2) — Ultrix-11 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getuid(2)

setregid(2)

setreuid(2)

seteuid(3)

setuid(2)

NAME

setuid, setgid − set user and group ID

SYNTAX

int setuid(uid)
int uid;

int setgid(gid)
int gid;

DESCRIPTION

The setuid system call sets the user ID of the calling process to uid. The setgid system call sets the group ID of the calling process to gid. Both the effective and the real IDs are set. 

RESTRICTIONS

These calls are only permitted to the superuser or if the argument is the real ID. 

RETURN VALUE

If unsuccessful, returns a −1, and the global variable errno indicates the error code. 

DIAGNOSTICS

The setuid call will if:

[EPERM] An attempt was made by a user other than the superuser to change the effective user ID to anything other than the real user ID. 

[EINVAL] The uid is out of range. 

The setgid call will fail if:

[EPERM] An attempt was made by a user other than the superuser to change the effective group ID to anything other than the real group ID. 

[EINVAL] The gid argument is out of range. 

ASSEMBLER

(setuid = 23.) 
(user ID in r0)
sys setuid

(setgid = 46.) 
(group ID in r0)
sys setgid

SEE ALSO

getuid(2), setregid(2), setreuid(2), seteuid(3)

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