Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (g - i) getpwnam(3)
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
All information generated by the getpwnam() function is stored in a static area and is overwrit-
ten 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 getpwnam(), set errno to 0 (zero) before the call.
RETURN VALUES
Upon successful completion, the getpwnam() 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 getpwnam() function sets errno to the correspond-
ing value:
[EAGAIN] A system resource is temporarily unavailable. The function cannot allocate
sufficient heap space to complete the call.
[EINVAL] The value specified for the name parameter is outside the range of valid values
for usernames or cannot be passed in the call for other reasons.
[EIO] A disk process or file system input or output error occurred. Data might have
been lost during the transfer.
[ENAMETOOLONG]
The value specified for the name parameter exceeds the maximum number of
characters allowed for a username.
[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] The specified username does not exist, or the name parameter contains an empty
string.
[ENOMEM] There is insufficient user memory to complete the call.
RELATED INFORMATION
Functions: endpwent(3), getpwent(3), getpwuid(3), setpwent(3).
STANDARDS CONFORMANCE
The HP implementation of this function does not return the errno values [EINTR], [EMFILE], or
[ENFILE].
The following are HP extensions to the XPG4 Version 2 specification:
• The errno values [EAGAIN], [EINVAL], [ENAMETOOLONG], [ENOCRE],
[ENOENT], and [ENOMEM] can be returned.
527192-005 Hewlett-Packard Company 3−33