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.  In the event  of
38       an error, errno is set to indicate the cause.
39

ERRORS

41       ENOMEM Insufficient memory to allocate group structure.
42

CONFORMING TO

44       SVr4.
45

SEE ALSO

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

COLOPHON

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