2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified Sat Jul 24 19:38:44 1993 by Rik Faith (faith@cs.unc.edu)
11 .TH fgetgrent 3 (date) "Linux man-pages (unreleased)"
13 fgetgrent \- get group file entry
16 .RI ( libc ", " \-lc )
20 .B #include <sys/types.h>
23 .BI "struct group *fgetgrent(FILE *" stream );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
35 glibc 2.19 and earlier:
41 function returns a pointer to a structure containing
42 the group information from the file referred to by
44 The first time it is called
45 it returns the first entry; thereafter, it returns successive entries.
46 The file referred to by
48 must have the same format as
53 The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
58 char *gr_name; /* group name */
59 char *gr_passwd; /* group password */
60 gid_t gr_gid; /* group ID */
61 char **gr_mem; /* NULL\-terminated array of pointers
62 to names of group members */
69 function returns a pointer to a
72 or NULL if there are no more entries or an error occurs.
73 In the event of an error,
75 is set to indicate the error.
79 Insufficient memory to allocate
83 For an explanation of the terms used in this section, see
91 Interface Attribute Value
94 T} Thread safety MT-Unsafe race:fgetgrent
99 .\" FIXME The marking is different from that in the glibc manual,
102 .\" fgetgrent: MT-Unsafe race:fgrent
104 .\" We think race:fgrent in glibc may be hard for users to understand,
105 .\" and have sent a patch to the GNU libc community for changing it to
106 .\" race:fgetgrent, however, something about the copyright impeded the