| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) | 
Open the host database file
#include <netdb.h> void sethostent( int stayopen );
If the stayopen flag is zero, queries use UDP datagrams.
libsocket
Use the -l socket option to qcc to link against this library.
The sethostent() routine opens the host database file.
You can use the sethostent() function to request the use of a connected TCP socket for queries.
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | No | 
This function uses static data; if the data is needed for future use, it should be copied before any subsequent calls overwrite it.
endhostent(), gethostbyaddr(), gethostbyname(), gethostent(), gethostent_r(), hostent
/etc/hosts, /etc/resolv.conf in the Utilities Reference
| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) |