getpwent - get user database entry
#include <pwd.h> struct passwd *getpwent(void);
Refer to endpwent().