[Previous] [Contents] [Index] [Next]

gethostent()

Read the next line of the host database file

Synopsis:

#include <netdb.h>

struct hostent * gethostent( void );

Library:

socket3r.lib, socket3s.lib

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.
/etc/resolv.conf
Resolver configuration file.

Classification:

Standard Unix, 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(), gethostent_r(), hostent, sethostent()

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


[Previous] [Contents] [Index] [Next]