Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ endgrent(3) — DG/UX 4.30

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bcs_cat(1M)

getlogin(3C)

getpwent(3)

group(5)

ypserv(8)



     getgrent(3)                DG/UX 4.30                 getgrent(3)



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

     SYNOPSIS
          #include <grp.h>

          struct group *getgrent()

          struct group *getgrgid(gid)
          int gid;

          struct group *getgrnam(name)
          char *name;

          void setgrent()

          void endgrent()

          struct group *fgetgrent()
          FILE *f;

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

               struct    group
                    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.

          Getgrent simply reads the next line while getgrgid and
          getgrnam search until a matching gid or name is found (or
          until EOF is encountered).  Each routine picks up where the
          others leave off so successive calls may be used to search
          the entire file.

          A call to setgrent has the effect of rewinding the group
          file to allow repeated searches.  Endgrent may be called to
          close the group file when processing is complete.




     Licensed material--property of copyright holder(s)         Page 1





     getgrent(3)                DG/UX 4.30                 getgrent(3)



          Fgetgrent returns a pointer to the next group structure in
          the stream f, which must refer to an open file in the same
          format as the group file /etc/group.

     FILES
          /etc/group

     SEE ALSO
          bcs_cat(1M), getlogin(3C), getpwent(3), group(5), ypserv(8).

     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.

     STANDARDS
          When using m88kbcs as the Software Development Environment
          target, the functions mentioned above will be implemented on
          top of the bcscat command.  Because of this, some
          performance degradation may be noticed in comparison to
          using these routines in /lib/libc.a.
































     Licensed material--property of copyright holder(s)         Page 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026