Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
getpwent_r(3) Guardian Native C Library Calls Reference Manual
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 must:
• Include the pwd.h header file
To use the Standard POSIX Threads library, you must:
• Include the spthread.h header file
• Link your application to the Standard POSIX Threads Library:
/G/system/sysnn/zsptsrl (G-series)
or
/G/system/zdllnnn/zsptdll (H-series or J-series)
• Compile your application using the #define _SPT_MODEL_ macro or an equivalent
compiler command option
For more information about threaded and 64-bit applications in the OSS environment, see the
Open System Services Programmer’s Guide.
The functions setpwent(), getpwent(), and endpwent() are used to enumerate password entries
from the database. The setpwent() function sets (or resets) the enumeration to the beginning of
the set of password entries. The setpwent() function should be called before the first call to
getpwent(). Successive calls to getpwent() return either successive entries or NULL (which
indicates the end of the enumeration). Interleaving calls to re-entrant functions and their
corresponding non re-entrant counterparts leave the enumeration in an undetermined state.
RETURN VALUES
H06.21 and later H-series RVUs and J06.10 and later J-series RVUs
Upon successful completion, the getpwent_r() function returns 0 (zero). Otherwise, the
getpwent_r() function sets errno to indicate the specific error.
Standard POSIX Threads Library version of getpwent_r()
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 these conditions occur, 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.
3−52 Hewlett-Packard Company 527192-018