1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" References consulted:
6 .\" Linux libc source code
7 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified Sat Jul 24 19:37:37 1993 by Rik Faith (faith@cs.unc.edu)
11 .\" Modified Mon May 27 22:40:48 1996 by Martin Schulze (joey@linux.de)
13 .TH FGETPWENT 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
15 fgetpwent \- get password file entry
18 .RI ( libc ", " \-lc )
22 .B #include <sys/types.h>
25 .BI "struct passwd *fgetpwent(FILE *" stream );
29 Feature Test Macro Requirements for glibc (see
30 .BR feature_test_macros (7)):
37 Glibc 2.19 and earlier:
43 function returns a pointer to a structure containing
44 the broken out fields of a line in the file \fIstream\fP.
45 The first time it is called it returns the first entry;
46 thereafter, it returns successive entries.
47 The file referred to by
49 must have the same format as
54 The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
59 char *pw_name; /* username */
60 char *pw_passwd; /* user password */
61 uid_t pw_uid; /* user ID */
62 gid_t pw_gid; /* group ID */
63 char *pw_gecos; /* real name */
64 char *pw_dir; /* home directory */
65 char *pw_shell; /* shell program */
72 function returns a pointer to a
75 there are no more entries or an error occurs.
76 In the event of an error,
78 is set to indicate the error.
82 Insufficient memory to allocate
88 password database file
90 For an explanation of the terms used in this section, see
98 Interface Attribute Value
101 T} Thread safety MT-Unsafe race:fgetpwent
106 .\" FIXME: The marking is different from that in the glibc manual,
109 .\" fgetpwent: MT-Unsafe race:fpwent
111 .\" We think race:fpwent in glibc maybe hard for users to understand,
112 .\" and have sent a patch to the GNU libc community for changing it to
113 .\" race:fgetpwent, however, something about the copyright impeded the