OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / getpwent.3
index 80cc5ab..d4b385e 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -19,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
@@ -28,7 +30,7 @@
 .\" 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  2009-03-30 "GNU" "Linux Programmer's Manual"
+.TH GETPWENT 3  2013-06-21 "GNU" "Linux Programmer's Manual"
 .SH NAME
 getpwent, setpwent, endpwent \- get password file entry
 .SH SYNOPSIS
@@ -52,7 +54,10 @@ Feature Test Macro Requirements for glibc (see
 .BR getpwent (),
 .BR setpwent (),
 .BR endpwent ():
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE > = 500
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
+_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+.RE
 .ad b
 .SH DESCRIPTION
 The
@@ -62,8 +67,9 @@ the broken-out fields of a record from the password database
 (e.g., the local password file
 .IR /etc/passwd ,
 NIS, and LDAP).
-The first time it
-is called it returns the first entry; thereafter, it returns successive
+The first time
+.BR getpwent ()
+is called, it returns the first entry; thereafter, it returns successive
 entries.
 .PP
 The
@@ -85,19 +91,22 @@ struct passwd {
     char   *pw_passwd;     /* user password */
     uid_t   pw_uid;        /* user ID */
     gid_t   pw_gid;        /* group ID */
-    char   *pw_gecos;      /* real name */
+    char   *pw_gecos;      /* user information */
     char   *pw_dir;        /* home directory */
     char   *pw_shell;      /* shell program */
 };
 .fi
 .in
-.SH "RETURN VALUE"
+.PP
+For more information about the fields of this structure, see
+.BR passwd (5).
+.SH RETURN VALUE
 The
 .BR getpwent ()
 function returns a pointer to a
 .I passwd
 structure, or NULL if
-there are no more entries or an error occurs.
+there are no more entries or an error occurred.
 If an error occurs,
 .I errno
 is set appropriately.
@@ -142,9 +151,23 @@ Insufficient buffer space supplied.
 .TP
 .I /etc/passwd
 local password database file
-.SH "CONFORMING TO"
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR getpwent ()
+function is not thread-safe.
+.LP
+The
+.BR setpwent ()
+and
+.BR endpwent ()
+functions are thread-safe.
+.SH CONFORMING TO
 SVr4, 4.3BSD, POSIX.1-2001.
-.SH "SEE ALSO"
+The
+.I pw_gecos
+field is not specified in POSIX, but is present on most implementations.
+.SH SEE ALSO
 .BR fgetpwent (3),
 .BR getpw (3),
 .BR getpwent_r (3),
@@ -152,3 +175,12 @@ SVr4, 4.3BSD, POSIX.1-2001.
 .BR getpwuid (3),
 .BR putpwent (3),
 .BR passwd (5)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.