2.9BSD/usr/man/cat3/getgrent.3

Compare this file to the similar file:
Show the results in this format:


GETGRENT(3)         UNIX Programmer's Manual          GETGRENT(3)

NAME
     getgrent, getgrgid, getgrnam, setgrent, endgrent - get group
     file entry

SYNOPSIS
     #include <grp.h>

     struct group *getgrent();

     struct group *getgrgid(gid) int gid;

     struct group *getgrnam(name) char *name;

     int setgrent();

     int endgrent();

DESCRIPTION
     _G_e_t_g_r_e_n_t, _g_e_t_g_r_g_i_d and _g_e_t_g_r_n_a_m each return pointers to an
     object with the following structure containing the broken-
     out fields of a line in the group file.

          struct    group { /* see getgrent(3) */
               char *gr_name;
               char *gr_passwd;
               int  gr_gid;
               char **gr_mem;
          };

     The members of this structure are:

     gr_name
          The name of the group.
     gr_passwd
          The encrypted password of the group.
     gr_gid
          The numerical group-ID.
     gr_mem
          Null-terminated vector of pointers to the individual
          member names.

     _G_e_t_g_r_e_n_t reads the next line (opening the file if neces-
     sary); _s_e_t_g_r_e_n_t rewinds the file; _e_n_d_g_r_e_n_t closes it.

     _G_e_t_g_r_g_i_d and _g_e_t_g_r_n_a_m search from the beginning until a
     matching _g_i_d or _n_a_m_e is found (or until EOF is encountered).

FILES
     /etc/group

SEE ALSO
     getlogin(3), getpwent(3), group(5)

Printed 7/31/83                                                 1

GETGRENT(3)         UNIX Programmer's Manual          GETGRENT(3)

DIAGNOSTICS
     A null pointer (0) is returned on EOF or error.

BUGS
     All information is contained in a static area so it must be
     copied if it is to be saved.

Printed 7/31/83                                                 2