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

System Functions (f - i) getpwent_r(2)
NAME
getpwent_r - Gets user attribute information from the user database (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <pwd.h>]
#include <spthread.h>
struct passwd *getpwent_r (
struct passwd *ret,
char *buffer,
size_t buen
);
PARAMETERS
ret Points to a passwd structure allocated by the caller.
buffer Points to the buffer supplied by the caller and used as a storage space for
returned data.
buflen Species the size of the buffer passed in bytes.
DESCRIPTION
The getpwent_r() function is the reentrant version of the getpwent() function.
The getpwent_r() function returns information about the next user in the user authentication
database. The rst call to the getpwent_r() function returns information about the rst user in
the database. Each subsequent call to getpwent_r() returns information for the next user entry,
unless an intervening call to the setpwent() function has reset the entry pointer to the beginning
of the database.
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 buen characters in size.
User Structure
The user passwd structure returned by the getpwent_r() function is dened in the pwd.h header
le. The structure has the following elds:
pw_name The user login name.
pw_passwd The users 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.
527186-007 Hewlett-Packard Company 3103