Section: C Library Functions (3)
Updated: 25 July 1998
Return to Main Contents
ares_gethostbyname_file - Lookup a name in the system's hosts file
int ares_gethostbyname_file(ares_channel channel, const char *name,
int family, struct hostent **host)
function performs a host lookup by name against the system's hosts file (or equivalent local hostname database).
parameter is required, but no asynchronous queries are performed. Instead, the
lookup is done via the same mechanism used to perform 'f' lookups
options field in ares_init_options(3)).
gives the hostname as a NUL-terminated C string, and
gives the desired type of address for the resulting host entry.
The return value indicates whether the query succeeded and, if not, how it
failed. It may have any of the following values:
The host lookup completed successfully and
now points to the result (and must be freed with ares_free_hostent(3)).
was not found.
There was a file I/O error while performing the lookup.
Memory was exhausted.
On successful completion of the query, the pointer pointed to by
points to a
containing the address of the host returned by the lookup. The user must
free the memory pointed to by
when finished with it by calling ares_free_hostent(3). If the lookup did
not complete successfully,
Added in c-ares 1.5.4
Copyright 1998 by the Massachusetts Institute of Technology.
- SEE ALSO