Open System Services System Calls Reference Manual (G06.28+, H06.05+)
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 buflen
);
PARAMETERS
ret Points to a 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 getnetent_r() function is the reentrant version of the getnetent() function.
The getnetent_r() function retrieves the next entry in the /etc/networks file. This function
returns a pointer to a netent structure, whose members specify information about a network. The
netent structure is defined in the netdb.h header file.
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 buflen 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 file was reached. If the call to
getnetent_r() fails, a null pointer is returned.
ERRORS
If this condition occurs, the getnetent_r() function sets errno to the corresponding 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 database file.
RELATED INFORMATION
Functions: getnetbyaddr(3), getnetbyaddr_r(2), getnetbyname(3), getnetbyname_r(2), get-
netent(3), setnetent(3), endnetent(3).
Files: networks(4).
527186-007 Hewlett-Packard Company 3−87