Open System Services Library Calls Reference Manual (G06.28+, H06.05+)
setnetent(3) OSS Library Calls Reference Manual
NAME
setnetent - Opens the networks database /etc/networks and sets the next entry to the first entry
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
void setnetent
int stay_open);
PARAMETERS
stay_open Specifying a nonzero value for this parameter means that the network database
will not be closed after calls to getnetbyaddr(), getnetbyname(), and get-
netent( ).
DESCRIPTION
The setnetent() (set network entry) function opens /etc/networks, the networks database file,
and sets the next entry marker to the first entry in the file.
NOTES
If the setnetent() function is called with a nonzero stay_open parameter, the connection remains
open until the endnetent( ) or exit() functions are called.
RETURN VALUES
Upon successful completion, the setnetent() function returns a value of 0 (zero). Otherwise, it
returns a value of -1.
ERRORS
The setnetent() function does not set errno.
FILES
/etc/networks The Internet network database file. Each record in the file occupies a single line
and has three fields: the network name, the network number, and aliases.
RELATED INFORMATION
Functions: endnetent(3), getnetbyaddr(3), getnetbyname(3), getnetent(3).
Files: networks(4).
6−30 Hewlett-Packard Company 527187-007