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

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

GETPWENT(3)

Contents


NAME    [Toc]    [Back]

       getpwent, setpwent, endpwent - get password file entry

SYNOPSIS    [Toc]    [Back]

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

       struct passwd *getpwent(void);

       void setpwent(void);

       void endpwent(void);

DESCRIPTION    [Toc]    [Back]

       The getpwent() function returns a pointer to a structure containing the
       broken out fields of a line from /etc/passwd.  The  first  time	it  is
       called  it  returns  the first entry; thereafter, it returns successive
       entries.

       The setpwent() function rewinds the file pointer to  the  beginning  of
       the /etc/passwd file.

       The endpwent() function closes the /etc/passwd file.

       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  getpwent() function returns the passwd structure, or NULL if there
       are no more entries 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, BSD 4.3

SEE ALSO    [Toc]    [Back]

      
      
       fgetpwent(3),   getpwnam(3),   getpwuid(3),   getpw(3),	  putpwent(3),
       passwd(5)



GNU				  1996-05-27			   GETPWENT(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