Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (s) sethostent(3)
NAME
sethostent - Opens the network host database /etc/hosts and sets the next entry to the first entry
in the database
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 sethostent(
int stay_open);
PARAMETERS
stay_open If this parameter is set to a nonzero value, the database will not be closed after
calls to gethostbyaddress( ), gethostbyname( ), gethostent( ), or their reentrant
versions.
DESCRIPTION
The sethostent( ) (set host entry) function opens /etc/hosts, the network host database file, and
sets the next entry marker to the first entry in the file.
The database can be closed using the endhostent( ) function.
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
sethostent( ) function resets the enumeration position for all threads.
RETURN VALUES
Upon successful completion, sethostent( ) returns a value of 0 (zero). Otherwise it returns a
value of -1.
ERRORS
No errors are returned by sethostent( ).
FILES
/etc/hosts The Internet network host database. Each record in the file occupies a single line
and has three elds: the host address, the host name, and aliases.
RELATED INFORMATION
Functions: endhostent(3), gethostbyaddr(3), gethostbyname(3).
Files: hosts(4), thread_safety(5).
527187-017 Hewlett-Packard Company 631