GETPWENT(3C) DOMAIN/IX SYS5 GETPWENT(3C)
NAME
getpwent, getpwuid, getpwnam, setpwent, endpwent - get pass-
word file entry
USAGE
#include <pwd.h>
struct passwd *getpwent()
struct passwd *getpwuid(uid)
int uid;
struct passwd *getpwnam(name)
char *name;
void setpwent()
void endpwent()
struct passwd *fgetpwent(f)
FILE *f;
DESCRIPTION
Getpwent, getpwuid and getpwnam each return a pointer to an
object with the following structure. It contains the
broken-out fields of a line in the password file.
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;
};
struct passwd *getpwent(), *getpwuid(), *getpwnam();
The fields pw_quota and pw_comment are unused. The rest are
described in the manual entry for passwd(5).
Getpwent reads the next line (opening the file if neces-
sary); setpwent rewinds the file; endpwent closes it.
Printed 12/4/86 GETPWENT-1
GETPWENT(3C) DOMAIN/IX SYS5 GETPWENT(3C)
Getpwuid and getpwnam search /etc/passwd from the beginning
until a matching uid or name is found (or until EOF is
encountered).
Fgetpwent returns a pointer to the next passwd structure in
the stream f, which matches the format of /etc/passwd.
NOTES
All information is contained in a static area so it must be
copied if it is to be saved.
On DOMAIN/IX Systems, /etc/passwd is built from registry
information by the program crpasswd(1M).
DIAGNOSTICS
Null pointer (zero) returned on EOF or error.
FILES
/etc/passwd the password file
RELATED INFORMATION
getlogin(3C), getgrent(3C), passwd(4)
GETPWENT-2 Printed 12/4/86