1FGETGRENT(3)               Linux Programmer's Manual              FGETGRENT(3)
2
3
4

NAME

6       fgetgrent - get group file entry
7

SYNOPSIS

9       #include <stdio.h>
10       #include <sys/types.h>
11       #include <grp.h>
12
13       struct group *fgetgrent(FILE *stream);
14
15   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17       fgetgrent(): _SVID_SOURCE
18

DESCRIPTION

20       The  fgetgrent()  function  returns a pointer to a structure containing
21       the group information from the file referred to by stream.   The  first
22       time  it  is  called it returns the first entry; thereafter, it returns
23       successive entries.  The file referred to by stream must have the  same
24       format as /etc/group (see group(5)).
25
26       The group structure is defined in <grp.h> as follows:
27
28           struct group {
29               char   *gr_name;        /* group name */
30               char   *gr_passwd;      /* group password */
31               gid_t   gr_gid;         /* group ID */
32               char  **gr_mem;         /* group members */
33           };
34

RETURN VALUE

36       The  fgetgrent()  function  returns  a pointer to a group structure, or
37       NULL if there are no more entries or an error occurs.
38

ERRORS

40       ENOMEM Insufficient memory to allocate group structure.
41

CONFORMING TO

43       SVr4.
44

SEE ALSO

46       endgrent(3), fgetgrent_r(3), fopen(3), getgrent(3), getgrgid(3), getgrā€
47       nam(3), putgrent(3), setgrent(3), group(5)
48

COLOPHON

50       This  page  is  part of release 3.22 of the Linux man-pages project.  A
51       description of the project, and information about reporting  bugs,  can
52       be found at http://www.kernel.org/doc/man-pages/.
53
54
55
56GNU                               2008-07-10                      FGETGRENT(3)
Impressum