Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getgrent(3)

ypserv(8)

getpwent(3)

getlogin(3)

group(4)



  getgrent(3)                         CLIX                         getgrent(3)



  NAME

    getgrent, getgrgid, getgrnam, setgrent, endgrent, fgetgrent - Accesses the
    basic group information in the user database

  LIBRARY

    Standard C Library (libc.a)

  SYNOPSIS

    #include <grp.h>

    struct group *getgrent(
      void );

    struct group *getgrgid(
      gid_t gid );

    struct group *getgrnam(
      char *name );

    void setgrent(
      void );

    void endgrent(
      void );

    struct group *fgetgrent(
      FILE *file );

  PARAMETERS

    name   Specifies the name of the group for which the basic attributes are
           to be read.

    gid    Specifies the group ID of the group for which the basic attributes
           are to be read.

    file   Specifies an open file whose format is like that of /etc/group.

  DESCRIPTION

    The getgrent(), getgrgid(), getgrnam(), setgrent(), endgrent(), and
    fgetgrent() functions may be used to access the basic group attributes.
    The group structure, which is returned by the getgrent(), getgrgid(),
    getgrnam() and fgetgrent() functions, is defined in the <grp.h> header
    file as follows:

    struct group {
        char   *gr_name;    /* the name of the group */



  2/94 - Intergraph Corporation                                              1






  getgrent(3)                         CLIX                         getgrent(3)



        char   *gr_passwd;  /* the encoded group password */
        int    gr_gid;      /* the numerical group ID */
        char   **gr_mem;    /* vector of pointers to member names */
    };

    The CLIX implementation of these functions includes support for the
    Network Information Services (NIS).  (See ypserv(8) for more information.)

    When first called, the getgrent() function returns a pointer to the first
    group structure in the file.  Thereafter, it returns a pointer to the next
    group structure in the file; so, successive calls may be used to search
    the entire file.

    The getgrgid() function searches from the beginning of the file until a
    numerical group ID matching the gid parameter is found and returns a
    pointer to the structure in which it was found.

    The getgrnam() function searches from the beginning of the file until a
    group name matching the name parameter is found and returns a pointer to
    the structure in which it was found.

    The setgrent() function rewinds the cursor to point to the first group
    entry in the group file.

    The fgetgrent() function returns a pointer to the next group structure in
    the stream file.  The stream file should match the format of the
    /etc/group file.

  FILES

    /etc/group   List of recognized group names and IDs on the system.

  NOTES

    The above functions use <stdio.h>, which causes them to increase the size
    of programs not otherwise using standard I/O more than expected.

  CAUTIONS

    The data returned by these functions is stored in a static area and will
    be overwritten on subsequent calls.  If this data is to be saved, it
    should be copied.

  RETURN VALUES

    The getgrent(), getgrnam,(), getgrgid(), and fgetgrent() functions return
    a pointer to a valid group structure containing a matching entry if
    successful.  Otherwise, NULL is returned.

  RELATED INFORMATION




  2                                              Intergraph Corporation - 2/94






  getgrent(3)                         CLIX                         getgrent(3)



    Commands:  ypserv(8)

    Functions:  getpwent(3), getlogin(3)

    Files:  group(4)

















































  2/94 - Intergraph Corporation                                              3




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