.\" Modified Sat Jul 24 19:22:14 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de)
.\"
-.TH GETPWENT 3 2015-03-02 "GNU" "Linux Programmer's Manual"
+.TH GETPWENT 3 2017-09-15 "GNU" "Linux Programmer's Manual"
.SH NAME
getpwent, setpwent, endpwent \- get password file entry
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.B #include <pwd.h>
-.sp
+.PP
.B struct passwd *getpwent(void);
-.sp
+.PP
.B void setpwent(void);
-.sp
+.PP
.B void endpwent(void);
.fi
-.sp
+.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.ad l
.BR getpwent (),
.BR setpwent (),
.BR endpwent ():
.RS 4
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
-_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+_XOPEN_SOURCE\ >=\ 500
+.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+ || /* Glibc since 2.19: */ _DEFAULT_SOURCE
+ || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
.RE
.ad b
.SH DESCRIPTION
after all processing has been performed.
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
-.sp
+.PP
.in +4n
-.nf
+.EX
struct passwd {
char *pw_name; /* username */
char *pw_passwd; /* user password */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
};
-.fi
+.EE
.in
.PP
For more information about the fields of this structure, see
If one wants to check
.I errno
after the call, it should be set to zero before the call.
-
+.PP
The return value may point to a static area, and may be overwritten
by subsequent calls to
.BR getpwent (),
.SH ERRORS
.TP
.B EINTR
-A signal was caught.
+A signal was caught; see
+.BR signal (7).
.TP
.B EIO
I/O error.
.TP
.B EMFILE
-The maximum number
-.RB ( OPEN_MAX )
-of files was open already in the calling process.
+The per-process limit on the number of open file descriptors has been reached.
.TP
.B ENFILE
-The maximum number of files was open already in the system.
+The system-wide limit on the total number of open files has been reached.
.TP
.B ENOMEM
.\" not in POSIX
.BR endpwent ()
T} Thread safety MT-Unsafe race:pwent locale
.TE
-
+.sp 1
In the above table,
.I pwent
in