.\" 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.
.\"
.\" 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
.\" 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
.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
(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
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.
.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),
.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/.