SETREUID(2,L) AIX Technical Reference SETREUID(2,L)
-------------------------------------------------------------------------------
setreuid, setregid
PURPOSE
Sets real and effective user and group IDs.
LIBRARY
Standard C Library (libc.a)
SYNTAX
int setreuid (ruid, euid)
int ruid, euid;
int setregid (rgid, egid)
int rgid, egid;
DESCRIPTION
The setreuid subroutine sets the real and effective user ID of the current
process according to the parameters ruid and euid. If either of these
parameters equals -1, the current user ID is used.
Any process can change the real user ID or the effective user ID to the other,
but only a process with an effective user ID of superuser can make other kinds
of changes.
The setregid subroutine sets the real and effective group ID of the current
process according to the parameters rgid and egid. If either of these
parameters equals -1, the current group ID is used.
Any process can change the real group ID or the effective group ID to the
other, but only a process with an effective user ID of superuser can make other
kinds of changes.
If you need the setruid or seteuid functions, they can be constructed as:
#define seteuid(id) setreuid(-1, (id))
#define setruid(id) setreuid((id), -1)
RETURN VALUE
When the call succeeds, a value of 0 is returned. If the setreuid or setregid
subroutines fail, a value of -1 is returned and errno is set to indicate the
error.
ERROR CONDITIONS
Processed November 7, 1990 SETREUID(2,L) 1
SETREUID(2,L) AIX Technical Reference SETREUID(2,L)
EPERM The current process does not have an effective user ID of superuser.
This process attempted to change other than from the effective user
(group) ID to the real user (group) ID, or vice versa.
RELATED INFORMATION
In this book: "getuid, geteuid, getgid, getegid" and "setuid, setgid."
Processed November 7, 1990 SETREUID(2,L) 2