SETREUID(2)
NAME
setreuid − set real and effective user ID
USAGE
setreuid(ruid, euid) int ruid, euid;
DESCRIPTION
For the current process, setreuid sets the real user ID to ruid and the effective user ID to euid. Only the super-user may change the real user ID of a process. Other users may only change the effective user ID to the real user ID.
RETURN VALUE
A successful call returns zero. A failed call returns -1 and sets errno as indicated below.
ERRORS
[EPERM] The current process is not the super-user and a change other than changing the effective group-ID to the real group-ID was specified.