Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
Guardian Native C Library Calls (g - i) getgrent(3)
NAME
getgrent - Gets group information from the group database
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZSECSRL
G-series native OSS processes: /G/system/sysnn/zsecsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZSECDLL
H-series OSS processes: /G/system/zdllnnn/zsecdll
SYNOPSIS
#include <grp.h>
struct group *getgrent(void);
DESCRIPTION
The getgrent( ), getgrgid(), getgrnam( ), setgrent(), and endgrent() functions are used to
access group attributes.
The getgrent( ) function returns information about the next group in the database. The get-
grent() function can be called only by native processes.
The getgrgid() function returns information about the group in the database whose group ID
matches the value specified in the gid parameter.
The getgrnam() function returns information about the group in the database whose group name
matches the name specified in the name parameter.
The setgrent() function resets the group name key so that the next call to getgrent() returns
information for the first group entry in the database.
The endgrent() function resets the group name key so that the next call to getgrent( ) returns
information for the first group entry in the database.
Database Structure
Traditional UNIX implementations access user and group information by sequentially reading
unstructured files. In contrast, an HP NonStop server stores user and group information in struc-
tured, key-sequenced, Enscribe files.
Group Structure
The group structure returned by the getgrent( ) function is defined in the grp.h header file. The
structure contains the following fields:
gr_name The group name of the group.
gr_passwd This field is not used by the system, so its value is meaningless.
gr_gid The group ID of the group.
gr_mem The members of the group.
Open System Services supports the following POSIX.1-compliant group declaration:
struct group {
char *gr_name;
char *gr_passwd;
gid_t gr_gid;
char **gr_mem;
};
The gr_passwd field is provided for compatibility with some versions of UNIX, but it always
contains a null string.
527192-007 Hewlett-Packard Company 3−17