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)
9 .\" Modified Sat Jul 24 19:38:44 1993 by Rik Faith (faith@cs.unc.edu)
10 .TH FGETGRENT 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
12 fgetgrent \- get group file entry
15 .RI ( libc ", " \-lc )
19 .B #include <sys/types.h>
22 .BI "struct group *fgetgrent(FILE *" stream );
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
34 Glibc 2.19 and earlier:
40 function returns a pointer to a structure containing
41 the group information from the file referred to by
43 The first time it is called
44 it returns the first entry; thereafter, it returns successive entries.
45 The file referred to by
47 must have the same format as
52 The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
57 char *gr_name; /* group name */
58 char *gr_passwd; /* group password */
59 gid_t gr_gid; /* group ID */
60 char **gr_mem; /* NULL\-terminated array of pointers
61 to names of group members */
68 function returns a pointer to a
71 or NULL if there are no more entries or an error occurs.
72 In the event of an error,
74 is set to indicate the error.
78 Insufficient memory to allocate
82 For an explanation of the terms used in this section, see
90 Interface Attribute Value
93 T} Thread safety MT-Unsafe race:fgetgrent
98 .\" FIXME The marking is different from that in the glibc manual,
101 .\" fgetgrent: MT-Unsafe race:fgrent
103 .\" We think race:fgrent in glibc may be hard for users to understand,
104 .\" and have sent a patch to the GNU libc community for changing it to
105 .\" race:fgetgrent, however, something about the copyright impeded the