getpwent(3) Library Functions Manual getpwent(3) getpwent, setpwent, endpwent - (libc -lc) #include #include struct passwd *getpwent(void); void setpwent(void); void endpwent(void); glibc ( feature_test_macros(7)): getpwent() setpwent() endpwent(): _XOPEN_SOURCE >= 500 || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE getpwent() ( /etc/passwd NIS LDAP). getpwent() . setpwent() . endpwent() . passwd : struct passwd { char *pw_name; /* */ char *pw_passwd; /* */ uid_t pw_uid; /* */ gid_t pw_gid; /* */ char *pw_gecos; /* */ char *pw_dir; /* */ char *pw_shell; /* */ }; passwd(5). getpwent() passwd NULL . errno . errno . getpwent() getpwnam(3) getpwuid(3). ( free(3).) EINTR signal(7). EIO /. EMFILE . ENFILE . ENOMEM passwd. ERANGE . /etc/passwd attributes(7). +----------------------+------------------------------------+----------+ | | | | +----------------------+------------------------------------+----------+ |getpwent() | | MT-Unsafe | | | | race:pwent | | | | race:pwentbuf | | | | locale | +----------------------+------------------------------------+----------+ |setpwent() | | | |endpwent() | | | | | | | | | | | | | | (MT-Unsafe) | | | | :pwent | | | | locale | +----------------------+------------------------------------+----------+ pwent race:pwent setpwent() getpwent() endpwent() . pw_gecos POSIX . POSIX.1-2008. POSIX.1-2001 SVr4 4.3BSD. fgetpwent(3) getpw(3) getpwent_r(3) getpwnam(3) getpwuid(3) putpwent(3) passwd(5) 3 . . : . 6.18 8 2026 getpwent(3)