SETRESUID(2) — HP-UX
NAME
setresuid, setresgid − set real, effective, and saved user and group IDs
SYNOPSIS
int setresuid (ruid, euid, suid)
int ruid, euid, suid;
int setresgid (rgid, egid, sgid)
int rgid, egid, sgid;
DESCRIPTION
Setresuid sets the real, effective and/or saved user ID of the calling process.
If the current real, effective or saved user ID is equal to the super-user’s user ID, setresuid sets the real, effective and saved user IDs to ruid, euid and suid, respectively. Otherwise, setresuid will only set the real, effective and saved user IDs if ruid, euid and suid each match at least one of the current real, effective or saved user IDs.
If ruid, euid or suid is -1, setresuid will leave the current real, effective or saved user ID unchanged.
Setresgid sets the real, effective and/or saved group ID of the calling process.
If the current real, effective or saved user ID is equal to the super-user’s user ID, setresgid sets the real, effective and saved group IDs to rgid, egid and sgid, respectively. Otherwise, setresgid will only set the real, effective and saved group IDs if rgid, egid and sgid each match at least one of the current real, effective or saved group IDs.
If rgid, egid or sgid is -1, setresgid will leave the current real, effective or saved group ID unchanged.
ERRORS
Setresuid and setresgid will fail and return -1 if:
[EINVAL] Ruid, euid or suid (rgid, egid or sgid) is not a valid user (group) ID.
[EPERM] None of the conditions above are met.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
AUTHOR
Setresuid and setresgid were developed by HP.
SEE ALSO
exec(2), getuid(2), setuid(2).
Hewlett-Packard Company — May 11, 2021