getpwuid [ MPE/iX Developer's Kit Reference Manual Volume I ] MPE/iX 5.0 Documentation
MPE/iX Developer's Kit Reference Manual Volume I
getpwuid
User database access based on UID.
Syntax
#include <sys/types.h>
#include <pwd.h>
struct passwd *getpwuid(uid_t uid);
Parameters
uid A value of a user ID.
Return Values
Returns a pointer to an object of type struct passwd on success. The
return values may point to static data that is overwritten by each cell.
A null pointer is returned on error or if the requested entry is not
found.
Description
The getpwuid() function returns a pointer to an object of type struct
passwd containing an entry from the group database with a matching uid or
name. This structure, which is defined in <pwd.h>, includes the members
shown in the following:
pw_name User name
pw_uid User ID number
pw_gid Group ID number
pw_dir Initial working directory
pw_shell Initial User Program
Implementation Considerations
None.
Errors
If an error occurs, errno is set to one of the following values:
EFAULT CAUSE The system detected a NULL or bad address when
attempting to allocate or access a struct passwd
buffer.
ACTION Report circumstances to HP
EINVAL CAUSE the UID parameter is invalid. No matching entry was
found in the passwd buffer.
ACTION Specify a valid UID.
ESYSERR CAUSE The system detected an unexpected error.
ACTION Report circumstances to HP.
See Also
getlogin(), getpwnam() POSIX.1
MPE/iX 5.0 Documentation