.\" Copyright (c) 1988 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)getpwent.3 6.4 (Berkeley) %G%
getpwent, getpwuid, getpwnam, setpwent, endpwent, setpwfile \- get password file entry
.B struct passwd *getpwuid(uid)
.B struct passwd *getpwnam(name)
.B struct passwd *getpwent()
each return a pointer to an object with the following structure,
containing the broken-out fields of a line in the password file,
are unused; the others have meanings described in
changes the default password file to
thus allowing usage of alternate password files. If \fIndbm\fP databases
are available for any password files, they are used, otherwise the file
itself is linearly searched.
opens the database or file (closing any previously opened database or file)
or rewinds it if it is already open.
closes any open databases or files.
search the entire database or file (opening it if necessary) for a matching
For programs wishing to read the entire database,
reads the next entry (opening the database or file if necessary).
getlogin(3), getgrent(3), passwd(5)
return a null pointer (0) on EOF or error.
returns 0 on failure, 1 on success.
All information is contained in a static area so it must be
copied if it is to be saved.