Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (s) setnetent(3)
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
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
[#include <sys/socket.h>]
#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( ), getnetent(),
or their reentrant versions.
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.
For enumeration in multithreaded applications, the position within the enumeration is a process-
wide property that is shared by all threads. When used in a multi-threaded application, the
setnetent( ) function resets the enumeration position for all threads.
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), thread_safetey(5).
527187-017 Hewlett-Packard Company 6−41