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

getpwnam(3) OSS Library Calls Reference Manual
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 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 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
sufcient 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.
3124 Hewlett-Packard Company 527187-017