Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getpwent(3) OSS Library Calls Reference Manual
Use From the Guardian Environment
The getpwent( ) function can be used by a Guardian process when the process has been compiled
using the #define _XOPEN_SOURCE_EXTENDED 1 feature-test macro or an equivalent com-
piler command option.
NOTES
All information generated by the getpwent( ) function is stored in a thread-specific area and is
overwritten on subsequent calls to the getpwent( ), getpwnam( ),orgetpwuid( ) function. If the
data must be reused, each string should be separately copied before any other function that uses
the thread-specific area is called.
To check for an error resulting from a call to getpwent( ), set errno to 0 (zero) before the call.
RETURN VALUES
Upon successful completion, the getpwent( ) function returns a pointer to a valid passwd struc-
ture. 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( ) function sets errno to the correspond-
ing value:
[EAGAIN] A system resource is temporarily unavailable. The function cannot allocate
sufcient 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.
RELATED INFORMATION
Functions: endpwent(3), getpwnam(3), getpwuid(3), setpwent(3).
STANDARDS CONFORMANCE
The HP implementation of this function does not return the errno values [EMFILE] or
[ENFILE].
The following are HP extensions to the XPG4 Version 2 specification:
The errno values [EAGAIN], [ENOCRE], [ENOENT], and [ENOMEM] can be
returned.
3118 Hewlett-Packard Company 527187-017