*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> getpwnam (3)              
Title
Content
Arch
Section
 

GETPWNAM(3)

Contents


NAME    [Toc]    [Back]

       getpwnam, getpwuid - get password file entry

SYNOPSIS    [Toc]    [Back]

       #include <pwd.h>
       #include <sys/types.h>

       struct passwd *getpwnam(const char * name);

       struct passwd *getpwuid(uid_t uid);

DESCRIPTION    [Toc]    [Back]

       The getpwnam() function returns a pointer to a structure containing the
       broken out fields of a line from /etc/passwd for the entry that matches
       the user name name.

       The getpwuid() function returns a pointer to a structure containing the
       broken out fields of a line from /etc/passwd for the entry that matches
       the user uid uid.

       The passwd structure is defined in <pwd.h> as follows:

	      struct passwd {
		      char    *pw_name;       /* user name */
		      char    *pw_passwd;     /* user password */
		      uid_t   pw_uid;	      /* user id */
		      gid_t   pw_gid;	      /* group id */
		      char    *pw_gecos;      /* real name */
		      char    *pw_dir;	      /* home directory */
		      char    *pw_shell;      /* shell program */
	      };

RETURN VALUE    [Toc]    [Back]

       The  getpwnam() and getpwuid() functions return a pointer to the passwd
       structure, or NULL if the matching entry  is  not  found  or  an  error
       occurs.

ERRORS    [Toc]    [Back]

       ENOMEM Insufficient memory to allocate passwd structure.

FILES    [Toc]    [Back]

       /etc/passwd
	      password database file

CONFORMING TO    [Toc]    [Back]

       SVID 3, POSIX, BSD 4.3

SEE ALSO    [Toc]    [Back]

      
      
       fgetpwent(3),   getgrnam(3),   getpwent(3),  setpwent(3),  endpwent(3),
       getpw(3), putpwent(3), passwd(5)



GNU				  1996-05-27			   GETPWNAM(3)
[ Back ]
 Similar pages
Name OS Title
putpwent Linux write a password file entry
putpwent IRIX write password file entry
putspent IRIX write shadow password file entry
getspent IRIX manipulate shadow password file entry
getpw Linux Re-construct password line entry
getprpwent Tru64 Manipulate protected password database entry (Enhanced Security)
putespwnam Tru64 Manipulate protected password database entry (Enhanced Security)
getespwuid Tru64 Manipulate protected password database entry (Enhanced Security)
getespwnam Tru64 Manipulate protected password database entry (Enhanced Security)
putprpwnam Tru64 Manipulate protected password database entry (Enhanced Security)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service