Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (g - i) getgrnam(3)
NAME
getgrnam - 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 <sys/types.h> /* optional except for POSIX.1 */
#include <grp.h>
struct group *getgrnam(
const char *name);
PARAMETERS
name Specifies the group name of the group for which information is to be retrieved.
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 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 node stores user and group information in
structured, key-sequenced, Enscribe files.
Group Structure
The group structure returned by the getgrnam() 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;
};
527192-005 Hewlett-Packard Company 3−21