Opens network host file.
Standard C Library (libc.a)
(libbind)
libnis)
(liblocal)
#include <netdb.h>
sethostent ( StayOpen)
int StayOpen;
When using the sethostent subroutine in DNS/BIND name service resolution, sethostent allows a request for the use of a connected socket using TCP for queries. If the StayOpen parameter is non-zero, this sets the option to send all queries to the name server using TCP and to retain the connection after each call to gethostbyname or gethostbyaddr.
When using the sethostent subroutine to search the /etc/hosts file, sethostent opens and rewinds the /etc/hosts file. If the StayOpen parameter is non-zero, the hosts database is not closed after each call to gethostbyname or gethostbyaddr.
Item | Description |
---|---|
StayOpen | When used in NIS name resolution and to search the local /etc/hosts file, it contains a value used to indicate whether to close the host file after each call to gethostbyname and gethostbyaddr. A non-zero value indicates not to close the host file after each call and a zero value allows the file to be closed. |
When used in DNS/BIND name resolution, a non-zero value retains the TCP connection after each call to gethostbyname and gethostbyaddr . A value of zero allows the connection to be closed. |
Item | Description |
---|---|
/etc/hosts | Contains the host name database. |
/etc/netsvc.conf | Contains the name services ordering. |
/etc/include/netdb.h | Contains the network database structure. |