Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (g - i) getpwent_r(3)
H06.21 and later H-series RVUs and J06.10 and later J-series RVUs
The user information is updated in the structure pointed to by the pwd parameter and a pointer to
that structure is stored at the location pointed to by the result parameter. Storage referenced by
the pwd structure is allocated from the memory provided with the buffer parameter, which is
buflen bytes in size. The maximum size needed for this buffer can be determined with the
_SC_GETPW_R_SIZE_MAX parameter of the sysconf() function. A NULL pointer is returned
at the location pointed to by the result parameter on error or if the requested entry is not found.
Standard POSIX Threads Library version of getpwent_r()
The getpwent_r() function updates the passwd structure pointed to by the ret parameter.
Storage referenced by the passwd structure is allocated from the memory provided using the
buffer parameter, which is buflen characters in size.
User Structure
The user passwd structure returned by the getpwent_r( ) function is defined in the pwd.h header
file. The structure has the following fields:
pw_name The user login name.
pw_passwd The user’s current password (not returned).
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 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 stores user and group information in struc-
tured, key-sequenced, Enscribe files. User information is accessed using a primary or alternate
key. You can specify a username or user ID 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.
NOTES
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model Library or the Standard POSIX Threads Library for
threaded applications.
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, if you are
NOT using the Standard POSIX Threads Library (this is not a threaded application or you are
using the POSIX User Thread Model Library) you can use this function with 32-bit or 64-bit OSS
applications.
527192-018 Hewlett-Packard Company 3−51