Retrieves an entry from the hosts database file. Format #include <netdb.h> struct hostent *gethostent (void);
1 – Description
The gethostent() function reads the next entry of the hosts database file (TCPIP$ETC:IPNODES.DAT). See the NETDB.H header file for a description of the hostent structure. The gethostent() function uses a common static area for its return values. Therefore, subsequent calls to gethostent() overwrite any existing host entry. You must make a copy of the host entry, if you wish to save it.
2 – Return Values
x A pointer to an object having the hostent structure. NULL Indicates an error; errno is set to one of the following values.
3 – Errors
ENETDOWN TCP/IP Services was not started. HOST_NOT_FOUND Host is unknown. NO_DATA The server recognized the request and the name, but no address is available for the name. Another type of name server request may be successful. NO_RECOVERY An unexpected server failure occurred. This is a nonrecoverable error. TRY_AGAIN A transient error occurred; for example, the server did not respond. A retry may be successful.