Open System Services System Calls Reference Manual (G06.28+)
getpwent_r(2) OSS System Calls Reference Manual
pw_shell The initial program for the user.
The pw_passwd, pw_age, pw_comment, and pw_gecos fields are provided for compatibility
with some versions of UNIX, but these fields always contain null strings.
Database Structure and Access
Traditional UNIX implementations access user and group information by sequentially reading
unstructured files. In contrast, an HP NonStop server node stores user and group information in
structured, key-sequenced, Enscribe files. User information is accessed using a primary or alter-
nate key. A username or user ID can be specified 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 satisfies 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 getpwent_r() function returns a pointer to a valid passwd
structure. Otherwise, the function returns a null pointer and sets errno to indicate the specific
error.
ERRORS
If any of the following conditions occurs, the getpwent_r() function sets errno to the
corresponding value:
[EAGAIN] A system resource is temporarily unavailable. The function cannot allocate
sufficient heap space to complete the call.
[EIO] A disk process or file 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] No more user authentication records exist in the database. (There is no next user
in the database.)
[ENOMEM] There is insufficient user memory to complete the call.
[ERANGE] Insufficient storage was supplied via buffer and buflen to contain the data to be
referenced by the resulting passwd structure.
RELATED INFORMATION
Functions: endpwent(3), getpwnam(3), getpwnam_r(2), getpwent(3), getpwuid(3),
getpwuid_r(2), setpwent(3).
STANDARDS CONFORMANCE
This function is an extension to the UNIX98 specification. Interfaces documented on this refer-
ence page conform to the following industry standards:
• IEEE Std 1003.1c-1995, POSIX System Application Program Interface
The use of the header file spthread.h is an HP exception to the POSIX standard.
3−84 Hewlett-Packard Company 527186-005