]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/getpwent.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / getpwent.3
index b74185c40c1b4c734af66143075936170240db6a..29a8bb40367c56f65a040ad9a54653d169663e8e 100644 (file)
 .\" 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  2013-06-21 "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
@@ -83,9 +85,9 @@ function is used to close the password database
 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 */
@@ -95,7 +97,7 @@ struct passwd {
     char   *pw_dir;        /* home directory */
     char   *pw_shell;      /* shell program */
 };
-.fi
+.EE
 .in
 .PP
 For more information about the fields of this structure, see
@@ -113,7 +115,7 @@ is set appropriately.
 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 (),
@@ -125,18 +127,17 @@ or
 .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
@@ -172,7 +173,7 @@ T{
 .BR endpwent ()
 T}     Thread safety   MT-Unsafe race:pwent locale
 .TE
-
+.sp 1
 In the above table,
 .I pwent
 in
@@ -185,7 +186,7 @@ or
 are used in parallel in different threads of a program,
 then data races could occur.
 .SH CONFORMING TO
-SVr4, 4.3BSD, POSIX.1-2001.
+POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
 The
 .I pw_gecos
 field is not specified in POSIX, but is present on most implementations.