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

System Functions (f - i) getgrnam_r(2)
NAME
getgrnam_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 getgrnam_r (
const char *name,
struct group *grp,
char *buffer,
size_t buen,
struct group **result
);
PARAMETERS
name Species the group name 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 getgrnam_r() function is the reentrant version of the getgrnam() function.
The getgrnam_r() function returns information about the group in the database whose group
name matches the name specied in the name parameter.
This 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 name. Storage referenced by the group structure is allocated from the memory pro-
vided with the buffer parameter, which is buen characters in size. A null pointer is returned at
the location pointed to by result if an error occurs or if the requested entry is not found.
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 getgrnam_r() function is dened in the grp.h header le.
The structure contains the following elds:
gr_name The group name of the group.
gr_passwd This eld is not used by the system, so its value is meaningless.
527186-005 Hewlett-Packard Company 351