2 .\" Copyright 1998 by the Massachusetts Institute of Technology.
4 .\" Permission to use, copy, modify, and distribute this
5 .\" software and its documentation for any purpose and without
6 .\" fee is hereby granted, provided that the above copyright
7 .\" notice appear in all copies and that both that copyright
8 .\" notice and this permission notice appear in supporting
9 .\" documentation, and that the name of M.I.T. not be used in
10 .\" advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission.
12 .\" M.I.T. makes no representations about the suitability of
13 .\" this software for any purpose. It is provided "as is"
14 .\" without express or implied warranty.
16 .TH ARES_GETHOSTBYNAME 3 "25 July 1998"
18 ares_gethostbyname_file \- Lookup a name in the system's hosts file
23 .B int ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
24 .B int \fIfamily\fP, struct hostent **host)
28 .B ares_gethostbyname_file
29 function performs a host lookup by name against the system's hosts file (or equivalent local hostname database).
32 parameter is required, but no asynchronous queries are performed. Instead, the
33 lookup is done via the same mechanism used to perform 'f' lookups
36 options field in \fIares_init_options(3)\fP).
39 gives the hostname as a NUL-terminated C string, and
41 gives the desired type of address for the resulting host entry.
43 The return value indicates whether the query succeeded and, if not, how it
44 failed. It may have any of the following values:
47 The host lookup completed successfully and
49 now points to the result (and must be freed with \fIares_free_hostent(3)\fP).
57 There was a file I/O error while performing the lookup.
62 On successful completion of the query, the pointer pointed to by
66 containing the address of the host returned by the lookup. The user must
67 free the memory pointed to by
69 when finished with it by calling \fIares_free_hostent(3)\fP. If the lookup did
70 not complete successfully,
77 .BR ares_gethostbyname (3),
78 .BR ares_free_hostent (3),
79 .BR ares_init_options (3)
83 Copyright 1998 by the Massachusetts Institute of Technology.