Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
Guardian Native C Library Calls (g - i) getpwuid(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 getpwuid() 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 getpwuid(), set errno to 0 (zero) before the call.
RETURN VALUES
Upon successful completion, the getpwuid() 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 getpwuid() 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 uid parameter is outside the range of valid values for
user IDs 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.
[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 user ID does not exist, or the uid parameter contains an empty
string.
[ENOMEM] There is insufficient user memory to complete the call.
RELATED INFORMATION
Functions: endpwent(3), getpwent(3), getpwnam(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], [ENOCRE], [ENOENT], and [ENOMEM] can
be returned.
527192-007 Hewlett-Packard Company 3−35