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

System Functions (f - i) getnetent_r(2)
NAME
getnetent_r - Gets the next entry in the network database (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 *getnetent_r (
struct netent *ret,
char *buffer,
int buen
);
PARAMETERS
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 Species the size of the buffer passed in bytes.
DESCRIPTION
The getnetent_r() function is the reentrant version of the getnetent() function.
The getnetent_r() function retrieves the next entry in the /etc/networks le. Thisfunction
returns a pointer to a netent structure, whose members specify information about a network. The
netent structure is dened in the netdb.h header le.
The getnetent_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 param-
eter, which is buen characters in size.
RETURN VALUES
Upon successful completion, the getnetent_r() function returns a pointer to a netent structure if
the next entry was retrieved, and a null pointer if the end of the le was reached. If the call to
getnetent_r() fails, a null pointer is returned.
ERRORS
If the following condition occurs, the getnetent_r() function sets errno to the corresponding
value:
[ERANGE] Insufcient storage was supplied via buffer and buen to contain the data to be
referenced by the resulting netent structure.
FILES
/etc/networks The Internet network database le.
RELATED INFORMATION
Functions: getnetbyaddr(3), getnetbyaddr_r(2), getnetbyname(3), getnetbyname_r(2), get-
netent(3), setnetent(3), endnetent(3).
Files: networks(4).
527186-005 Hewlett-Packard Company 367