setuid(2)
_________________________________________________________________
setuid System Call
Set the real-, effective-, and saved-user-ids.
_________________________________________________________________
SYNTAX
int setuid (uid)
int uid;
PARAMETERS
uid The value to which the calling process's real-,
effective-, and saved-user-ids are to be set.
DESCRIPTION
Setuid sets the real-user-id, effective-user-id, and saved-user-
id of the calling process to <uid>, subject to the access control
constraints described below.
The value of <uid> must always be non-negative and less than or
equal to MAXUID.
ACCESS CONTROL
If the effective-user-id of the calling process is superuser the
real-user-id, effective-user-id, and saved_user_id values are all
set to <uid>.
If the effective-user-id of the calling process is not superuser,
but its real-user-id or its saved_user_id is equal to <uid>, the
effective-user-id is set to <uid>. The real-user-id and
saved_user_id are unchanged.
RETURN VALUE
0 Successful completion.
-1 An error occurred. Errno is set to indicate the
error.
EXCEPTIONS
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
setuid(2)
Errno may be set to one of the following error codes:
EPERM An attempt was made to set the effective-user-id
to a value not permitted by the access control
restrictions described above.
EINVAL The supplied value of <uid> was negative or
greater than MAXUID.
SEE ALSO
The related system calls: getuid, geteuid, getgid, getegid,
setgid, setregid, setreuid.
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)