Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) seteuid(2)
NAME
seteuid - Sets the effective user ID of the calling process
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsecsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zsecdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ysecdll
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
int seteuid( uid_t euid );
PARAMETERS
euid Specifies the new effective user ID.
DESCRIPTION
The seteuid( ) function sets the effective user ID of the calling process to the value specified by
the euid parameter.
The process that calls this function must have appropriate privileges. A process without appropri-
ate privileges can set the effective user ID only if the euid parameter is equal to either the real or
saved-set-user-ID of the process.
The value of the euid parameter must be in the range 0 (zero) through 65535.
The real user ID and the saved-set-user-ID of the calling process are not changed.
Use on Guardian Objects
Changing the effective user ID sets the process access ID (PAID) to the value of the effective
user ID.
NOTES
This function is supported on systems running J06.07 and later J-series RVUs, H06.18 and later
H-series RVUs, and G06.33 and later G-series RVUs.
This function does not set the default file security of a process. To set the default file security for
a process, use the PROCESS_SETINFO_ Guardian procedure call with item code 41.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned
and errno is set to indicate the error.
ERRORS
If any these conditions occur, the seteuid() function sets errno to the corresponding value:
[EINVAL] The value of the euid parameter is invalid or out of range.
[EPERM] The current process does not have appropriate privileges and the euid parameter
does not match the real user ID or the saved-set-user-ID of the process.
RELATED INFORMATION
Functions: getuid(2), setuid(2).
STANDARDS CONFORMANCE
The following are HP extensions to the XPG4 Version 2 specification:
If both the real and effective user IDs are changed so that they differ from each other and
from the saved-set-user-ID, then the saved-set-user-ID is set to the value of the effective
user ID.
527186-023 Hewlett-Packard Company 755