jpayne@68
|
1 .\"
|
jpayne@68
|
2 .\" Copyright 2023 by the c-ares project and its contributors
|
jpayne@68
|
3 .\" SPDX-License-Identifier: MIT
|
jpayne@68
|
4 .\"
|
jpayne@68
|
5 .TH ARES_REINIT 3 "12 November 2023"
|
jpayne@68
|
6 .SH NAME
|
jpayne@68
|
7 ares_reinit \- ReInitialize a resolver channel from system configuration.
|
jpayne@68
|
8 .SH SYNOPSIS
|
jpayne@68
|
9 .nf
|
jpayne@68
|
10 #include <ares.h>
|
jpayne@68
|
11
|
jpayne@68
|
12 int ares_reinit(ares_channel_t *\fIchannel\fP)
|
jpayne@68
|
13 .fi
|
jpayne@68
|
14 .SH DESCRIPTION
|
jpayne@68
|
15 The \fBares_reinit(3)\fP function re-reads the system configuration and safely
|
jpayne@68
|
16 applies the configuration to the existing channel. System configuration will
|
jpayne@68
|
17 never override user-provided settings such as provided via
|
jpayne@68
|
18 \fBares_init_options(3)\fP or \fBares_set_servers(3)\fP.
|
jpayne@68
|
19
|
jpayne@68
|
20 Any existing queries will be automatically requeued if the server they are
|
jpayne@68
|
21 currently assigned to is removed from the system configuration.
|
jpayne@68
|
22
|
jpayne@68
|
23 This function may cause additional file descriptors to be created, and existing
|
jpayne@68
|
24 ones to be destroyed if server configuration has changed.
|
jpayne@68
|
25
|
jpayne@68
|
26 \Bares_reinit(3)\fP, when compiled with thread safety, will spawn a background
|
jpayne@68
|
27 thread to read the configuration and apply it. It is crucial that developers
|
jpayne@68
|
28 use the \fBARES_OPT_SOCK_STATE_CB\fP or \fBARES_OPT_EVENT_THREAD\fP so that
|
jpayne@68
|
29 notifications of changes are alerted. If using \fBares_getsock(3)\fP or
|
jpayne@68
|
30 \fBares_fds(3)\fP, no notification is possible which could cause a stall.
|
jpayne@68
|
31
|
jpayne@68
|
32 .SH RETURN VALUES
|
jpayne@68
|
33 \fIares_reinit(3)\fP can return any of the following values:
|
jpayne@68
|
34 .TP 14
|
jpayne@68
|
35 .B ARES_SUCCESS
|
jpayne@68
|
36 Initialization succeeded.
|
jpayne@68
|
37 .TP 14
|
jpayne@68
|
38 .B ARES_EFILE
|
jpayne@68
|
39 A configuration file could not be read.
|
jpayne@68
|
40 .TP 14
|
jpayne@68
|
41 .B ARES_ENOMEM
|
jpayne@68
|
42 The process's available memory was exhausted.
|
jpayne@68
|
43
|
jpayne@68
|
44 .SH AVAILABILITY
|
jpayne@68
|
45 This function was first introduced in c-ares version 1.22.0.
|
jpayne@68
|
46 .SH SEE ALSO
|
jpayne@68
|
47 .BR ares_init (3),
|
jpayne@68
|
48 .BR ares_init_options (3),
|
jpayne@68
|
49 .BR ares_destroy (3),
|
jpayne@68
|
50 .BR ares_dup (3),
|
jpayne@68
|
51 .BR ares_library_init (3),
|
jpayne@68
|
52 .BR ares_set_servers (3),
|
jpayne@68
|
53 .BR ares_threadsafety (3)
|