getnetgrent_r Subroutine

Purpose

Handles the group network entries.

Library

Standard C Library (libc.a)

Syntax

#include<netdb.h>
int getnetgrent_r(machinep, namep, domainp, ptr)
 char **machinep, **namep, **domainp;
void **ptr;

Description

The getnetgrent_r subroutine internally calls the getnetgrent subroutine and stores the information in the structure data. This subroutine returns 1 or 0, depending if netgroup contains the machine, user, and domain triple as a member. Any of these three strings can be NULL, in which case it signifies a wild card.

The getnetgrent_r subroutine returns the next member of a network group. After the call, the machinep parameter contains a pointer to a string containing the name of the machine part of the network group member. The namep and domainp parameters contain similar pointers. If machinep, namep, or domainp is returned as a NULL pointer, it signifies a wild card.

The getnetgrent subroutine overwrites the static data returned in subsequent calls. The getnetgrent_r subroutine does not.

Parameters

Item Description
machinep Points to the string containing the machine part of the network group.
namep Points to the string containing the user part of the network group.
domainp Points to the string containing the domain name.
ptr Keeps the function threadsafe.

Return Values

The function returns a 0 if successful and a -1 if unsuccessful.

Files

Item Description
/etc/netgroup Contains network groups recognized by the system.
/usr/include/netdb.h Contains the network database structures.