getpwnam [ MPE/iX Developer's Kit Reference Manual Volume I ] MPE/iX 5.0 Documentation
MPE/iX Developer's Kit Reference Manual Volume I
getpwnam
User database access based on UID
User database access.
Syntax
#include <sys/types.h>
#include <pwd.h>
struct passwd *getpwnam(const char *name);
Parameters
name A character string value corresponding to the user name.
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 getpwnam() function is used to obtain entry from the user database
with a matching name. This structure, which is defined in <pwd.h>,
includes the members shown below:
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 name parameter is invalid. No matching entry was
found in the group database.
ACTION Specify a valid name.
ESYSERR CAUSE The system detected an unexpected error.
ACTION Report circumstances to HP.
See Also
getlogin(), getpwuid(), POSIX.1
MPE/iX 5.0 Documentation