sethostent()

open the host database file

Synopsis:

#include <netdb.h>

void sethostent( int stayopen );

Description:

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. If the stayopen flag is nonzero, all queries to the name server will use TCP and the connection will be retained after each call to gethostbyname() or gethostbyaddr(). If the stayopen flag is zero, queries use UDP datagrams.

Classification:

POSIX 1003.1g (draft)

Safety:
Interrupt handler No
Signal handler No
Thread No

Caveats:

This function uses static data; if the data is needed for future use, it should be copied before any subsequent calls overwrite it.

See also:

endhostent(), gethostbyaddr() gethostbyname() gethostent(), hostent

/etc/hosts, /etc/resolv.conf, named in the TCP/IP User's Guide