Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

getpwnam

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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:

EFAULTCAUSEThe system detected a NULL or bad address when attempting to allocate or access a struct passwd buffer.
 ACTIONReport circumstances to HP
EINVALCAUSEThe name parameter is invalid. No matching entry was found in the group database.
 ACTIONSpecify a valid name.
ESYSERRCAUSEThe system detected an unexpected error.
 ACTIONReport circumstances to HP.

See Also

getlogin(), getpwuid(), POSIX.1

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.