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

sethostent(3) OSS Library Calls Reference Manual
NAME
sethostent - Opens the network host database /etc/hosts and sets the next entry to the rst entry
in the database
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#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(), or gethostent().
DESCRIPTION
The sethostent( ) (set host entry) function opens /etc/hosts, the network host database le, and
sets the next entry marker to the rst entry in the le.
The database can be closed using the endhostent( ) function.
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 le 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).
620 Hewlett-Packard Company 527187-007