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