Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

Guardian Native C Library Calls (g - i) getpwent(3)
Use From the Guardian Environment
The getpwent() function can be used by a Guardian process when the process has been compiled
using the #dene _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 static 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 static 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 specic 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 le 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 insufcient 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 specication:
The errno values [EAGAIN], [ENOCRE], [ENOENT], and [ENOMEM] can be
returned.
527192-007 Hewlett-Packard Company 331