NAME

SYNOPSIS

DESCRIPTION

The
getpwent()
function returns a pointer to a structure containing the broken-out fields of
an entry in the user database. Each entry in the user database contains a
passwd structure. When first called,
getpwent()
returns a pointer to a passwd structure containing the first entry in
the user database. Thereafter, it returns a pointer to a passwd
structure containing the next entry in the user database. Successive calls
can be used to search the entire user database.

If an end-of-file or an error is encountered on reading,
getpwent()
returns a null pointer.

EXAMPLES

None.

APPLICATION USAGE

These functions are provided due to their historical usage. Applications
should avoid dependencies on fields in the password database, whether the
database is a single file, or where in the filesystem namespace the database
resides. Applications should use
getpwuid()
whenever possible both because it avoids these dependencies and for greater
portability with systems that conform to earlier versions of this
specification.