NAME
setuid —
set-user-ID
SYNOPSIS
#include <sys/types.h> #include <unistd.h> int setuid(uid_t uid);
DESCRIPTION
If the process has appropriate privileges, setuid() sets the real user ID, effective user ID, and the saved set-user-ID to uid .
If the process does not have appropriate privileges, but uid is equal to the real user ID or the saved set-user-ID, setuid() sets the effective user ID to uid; the real user ID and saved set-user-ID remain unchanged.
RETURN VALUE
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The setuid() function will fail and return -1 and set errno to the corresponding value if one or more of the following are true:
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
exec(3) , geteuid(3) , getuid(3) , setgid(3) , <sys/types.h> , <unistd.h> .
DERIVATION
Derived from Issue 1 of the SVID.