gethostent()

read the next line of the host database file

Synopsis:

#include <netdb.h>

struct hostent *gethostent( void );

Description:

The gethostent() routine reads the next line in the host database file.

Returns:

A pointer to a valid hostent structure, or NULL if an error occurs.

Files:

/etc/hosts
Host database file.

Classification:

POSIX 1003.1g (draft)

Safety:
Interrupt handler No
Signal handler No
Thread No

Caveats:

This function uses static data storage; if the data is needed for future use, it should be copied before any subsequent calls overwrite it. Currently, only the Internet address format is understood.

See also:

endhostent(), gethostbyaddr() gethostbyname() hostent, sethostent()

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