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

getpwnam_r(2) OSS System Calls Reference Manual
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 getpwnam() function returns a 0 (zero). Otherwise, a nonzero
error number is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the getpwnam_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 name parameter is outside the range of valid values
for usernames 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.
[ENAMETOOLONG]
The value specied for the name parameter exceeds the maximum number of
characters allowed for a username.
[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 username does not exist, or the name parameter contains an empty
string.
[ENOMEM] There is insufcient user memory to complete the call.
386 Hewlett-Packard Company 527186-005