Open System Services System Calls Reference Manual (G06.28+)
System Functions (f - i) getnetbyname_r(2)
NAME
getnetbyname_r - Gets a network entry by name (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <netdb.h>]
#include <spthread.h>
struct netent *getnetbyname_r (
const char *name,
struct netent *ret,
char *buffer,
int buflen
);
PARAMETERS
name Specifies the network name or alias.
ret Points to a struct netent structure allocated by the caller.
buffer Points to the buffer supplied by the caller and used as a storage space for
returned data.
buflen Specifies the size of the buffer passed in bytes.
DESCRIPTION
The getnetbyname_r( ) function is the reentrant version of the getnetbyname( ) function.
The getnetbyname_r( ) function searches the /etc/networks file sequentially until a match with
the name parameter is found. This function returns a pointer to a structure of type netent whose
members specify data from the /etc/networks network database file. The netdb.h header file
defines the netent structure.
The getnetbyname_r( ) function updates the netent structure pointed to by the ret parameter.
Storage referenced by the netent structure is allocated from the memory provided using the
buffer parameter, which is buflen characters in size.
RETURN VALUES
Upon successful completion, the getnetbyname_r( ) function returns a pointer to a netent struc-
ture if the network name was found, and a null pointer if it was not found. If the call to
getnetbyname_r() fails, a null pointer is returned.
ERRORS
If the following condition occurs, the getnetbyname_r() function sets errno to the correspond-
ing value:
[ERANGE] Insufficient storage was supplied via buffer and buflen to contain the data to be
referenced by the resulting netent structure.
FILES
/etc/networks The Internet network name database file.
527186-005 Hewlett-Packard Company 3−65