getpwent man page on OPENSTEP

Man page or keyword search:  
man Server   1419 pages
apropos Keyword Search (all sections)
Output format
OPENSTEP logo
[printable version]


GETPWENT(3)							   GETPWENT(3)

NAME
       getpwent,  getpwuid,  getpwnam,	setpwent,  endpwent,  setpwfile	 - get
       password file entry

SYNOPSIS
       #include <pwd.h>

       struct passwd *getpwuid(uid)
       int uid;

       struct passwd *getpwnam(name)
       char *name;

       struct passwd *getpwent()

       setpwent()

       endpwent()

       setpwfile(name)
       char *name;

DESCRIPTION
       Getpwent, getpwuid and getpwnam each return a pointer to an object with
       the  following  structure containing the broken-out fields of a line in
       the password database.

	      struct	passwd { /* see getpwent(3) */
		   char *pw_name;
		   char *pw_passwd;
		   int	pw_uid;
		   int	pw_gid;
		   int	pw_quota;
		   char *pw_comment;
		   char *pw_gecos;
		   char *pw_dir;
		   char *pw_shell;
	      };

       The fields pw_quota and pw_comment are unused; the others have meanings
       described in passwd(5).

       If  the	flat file is searched, then searching of the password file may
       be done using the ndbm database access routines.

       Setpwent opens the database; endpwent closes it.	 Getpwuid and getpwnam
       search  the  database  (opening	it if necessary) for a matching uid or
       name.  EOF is returned if there is no entry.

       For programs wishing to read the entire database,  getpwent  reads  the
       next  line (opening the database if necessary).	In addition to opening
       the database, setpwent can be used to make getpwent  begin  its	search
       from the beginning of the database.

       Setpwfile  changes  the	default	 password  file	 to name thus allowing
       alternate password files to be used.  Note that it does not  close  the
       previous	 file.	If this is desired, endpwent should be called prior to
       it.

FILES
       /etc/passwd - if NetInfo is not running, or if YP is enabled

SEE ALSO
       getlogin(3), getgrent(3), passwd(5), netinfo(5), lookupd(8)

DIAGNOSTICS
       The routines getpwent, getpwuid, and getpwnam, return  a	 null  pointer
       (0) on EOF or error.

BUGS
       All  information	 is contained in a static area so it must be copied if
       it is to be saved.

7th Edition			October 8, 1990			   GETPWENT(3)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OPENSTEP

List of man pages available for OPENSTEP

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net