.TH sethostent() "" "" "Sockets Function (libsocket)"
.PC "Open and rewind file /etc/hosts"
.B "#include <netdb.h>"
\fBvoid sethostent(\fIstayopen\^\fB)\fR
\fBint \fIstayopen\^\fB;\fR
.PP
The function
.B sethostent()
is one of a set of functions that interrogate the file
.B /etc/hosts
to look up information about a remote host on a network.
It opens and rewinds
.BR /etc/hosts .
.PP
Flag
.I stayopen
indicates whether
.B /etc/hosts
is to stay open after it has been interrogated by
.B gethostbyaddr()
or
.BR gethostbyname() :
if it is zero, then
.B /etc/hosts
is closed after it is interrogated; if it is nonzero, then
.B /etc/hosts
remains open.
.SH "See Also"
.Xr "endhostent()," endhosten
.Xr "gethostbyaddr()," gethostba
.Xr "gethostbyname()," gethostbn
.Xr "libsocket" libsocket
