Open System Services System Calls Reference Manual (G06.28+)

System Functions (f - i) getpwuid_r(2)
pw_uid The user ID of the user.
pw_gid The group ID of the primary group of the user.
pw_age The password aging string (not returned).
pw_comment Comment string (not returned).
pw_gecos Personal information about the user (not returned).
pw_dir The home directory of the user.
pw_shell The initial program for the user.
The pw_passwd, pw_age, pw_comment, and pw_gecos elds are provided for compatibility
with some versions of UNIX, but these elds always contain null strings.
Database Structure and Access
Traditional UNIX implementations access user and group information by sequentially reading
unstructured les. In contrast, an HP NonStop server node stores user and group information in
structured, key-sequenced, Enscribe les. User information is accessed using a primary or alter-
nate key. A username or user ID can be specied as a key.
Sequential access to user information is supported by storing the most recently used key in static
storage. The setpwent() function resets this key. The endpwent() function satises references
when linking user applications.
OSS user authentication database functions do not leave the database open between calls.
Authentication records for user aliases follow regular user authentication records in the database.
RETURN VALUES
Upon successful completion, the getpwuid_r( ) function returns a 0 (zero). Otherwise, a nonzero
error number is returned and the function sets errno to indicate the specic error.
ERRORS
If any of the following conditions occurs, the getpwuid_r() function sets errno to the
corresponding value:
[EAGAIN] A system resource is temporarily unavailable. The function cannot allocate
sufcient heap space to complete the call.
[EINVAL] The value specied for the uid parameter is outside the range of valid values for
user IDs or cannot be passed in the call for other reasons.
[EIO] A disk process or le system input or output error occurred. Data might have
been lost during the transfer.
[ENOCRE] The calling process does not use the Common Run-Time Environment (CRE)
but requested a service that requires CRE (the static area cannot be allocated in
the calling process).
[ENOENT] The specied user ID does not exist, or the uid parameter contains an empty
string.
[ENOMEM] There is insufcient user memory to complete the call.
[ERANGE] Insufcient storage was supplied via buffer and buen to contain the data to be
referenced by the resulting passwd structure.
527186-005 Hewlett-Packard Company 389