Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

getnetent(3) OSS Library Calls Reference Manual
NAME
getnetent - Gets the next entry in the network database
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
struct netent *getnetent(void);
DESCRIPTION
The getnetent() function retrieves the next entry in the /etc/networks le.
The getnetent() function returns a pointer to a netent structure, whose members specify informa-
tion about a network. The netent structure is dened in the netdb.h header le.
Use the endnetent( ) function to close the /etc/networks le.
NOTES
The getnetent() return value points to static data, which is overwritten by subsequent calls to
getnetbyaddr(), getnetbyname(),orgetnetent().
RETURN VALUES
Upon successful completion, the getnetent() 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() fails, a null pointer is returned.
The getnetent() function does not set errno.
FILES
/etc/networks The Internet network database le. Each record in the le occupies a single line
and has three elds: the network name, the network number, and aliases.
RELATED INFORMATION
Functions: getnetbyaddr(3), getnetbyname(3), setnetent(3), endnetent(3).
Files: networks(4).
352 Hewlett-Packard Company 527187-007