Returns information about a user in the directory.
#include <pwd.h> struct passwd *getpwent ( void );
If successful, returns a pointer to a passwd structure. Otherwise, returns a NULL pointer if no more entries are found or an error occurs. If an error occurs, errno is also set.
The getpwent function can be used enumerate all users in the directory. The first call returns information about the first user in the system. Subsequent calls enumerate the other users. However, the function isn't reentrant and subsequent calls to the getpwuid, getpwnam, or getpwent functions might overwrite any results returned.