Open System Services System Calls Reference Manual (G06.28+)

System Functions (f - i) getgrgid_r(2)
NAME
getgrgid_r - Gets group information from the group database (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <sys/types.h>]
[#include <grp.h>]
#include <spthread.h>
int getgrgid_r (
gid_t gid ,
struct group *grp,
char *buffer,
size_t buen,
struct group **result
);
PARAMETERS
gid Species the group ID of the group for which information is to be retrieved.
grp Points to a struct group structure allocated by the caller.
buffer Points to the buffer supplied by the caller and used as a storage space for grp
data.
buflen Species the size of the buffer passed in bytes.
result Points to the struct group that is returned in the grp parameter.
DESCRIPTION
The getgrgid_r() function is the reentrant version of the getgrgid() function.
The getgrgid_r() function returns information about the group in the database whose group ID
matches the value specied in the gid parameter.
The getgrgid_r() function updates the group structure pointed to by grp and stores a pointer to
that structure at the location pointed to by result. The structure contains an entry from the group
database with a matching gid. Storage referenced by the group structure is allocated from the
memory provided with the buffer parameter, which is buen characters in size. If an error occurs
or if the requested entry cannot be found, a null pointer is returned at the location pointed to by
result.
Database Structure
Traditional UNIX implementations access user and group information by sequentially reading
unstructured les. In contrast, an HP NonStop server node stores user and group information in
structured, key-sequenced, Enscribe les.
Group Structure
The group structure returned by the getgrgid_r() function is dened in the grp.h header le.
The structure contains the following elds:
gr_name The group name of the group.
527186-005 Hewlett-Packard Company 349