blob: 0baf4b76fea59f5896f3347dd9ba1f7c9ab10931 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001.\"
2.\" Copyright 1998 by the Massachusetts Institute of Technology.
3.\" Copyright (C) 2004-2010 by Daniel Stenberg
4.\"
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.
16.\"
17.TH ARES_INIT 3 "5 March 2010"
18.SH NAME
19ares_init \- Initialize a resolver channel
20.SH SYNOPSIS
21.nf
22#include <ares.h>
23
24int ares_init(ares_channel *\fIchannelptr\fP)
25.fi
26.SH DESCRIPTION
27The \fBares_init(3)\fP function initializes a communications channel for name
28service lookups. If it returns successfully, \fBares_init(3)\fP will set the
29variable pointed to by \fIchannelptr\fP to a handle used to identify the name
30service channel. The caller should invoke \fIares_destroy(3)\fP on the handle
31when the channel is no longer needed.
32
33The \fIares_init_options(3)\fP function is provide to offer more init
34alternatives.
35.SH RETURN VALUES
36\fIares_init(3)\fP can return any of the following values:
37.TP 14
38.B ARES_SUCCESS
39Initialization succeeded.
40.TP 14
41.B ARES_EFILE
42A configuration file could not be read.
43.TP 14
44.B ARES_ENOMEM
45The process's available memory was exhausted.
46.TP 14
47.B ARES_ENOTINITIALIZED
48c-ares library initialization not yet performed.
49.SH NOTES
50When initializing from
51.B /etc/resolv.conf,
52.BR ares_init (3)
53reads the
54.I domain
55and
56.I search
57directives to allow lookups of short names relative to the domains
58specified. The
59.I domain
60and
61.I search
62directives override one another. If more that one instance of either
63.I domain
64or
65.I search
66directives is specified, the last occurrence wins. For more information,
67please see the
68.BR resolv.conf (5)
69manual page.
70.SH SEE ALSO
71.BR ares_init_options(3),
72.BR ares_destroy(3),
73.BR ares_dup(3),
74.BR ares_library_init(3),
75.BR ares_set_servers(3)
76.SH AUTHOR
77Greg Hudson, MIT Information Systems
78.br
79Copyright 1998 by the Massachusetts Institute of Technology.
80.br
81Copyright (C) 2004-2010 by Daniel Stenberg.