1ARES_SAVE_OPTIONS(3) Library Functions Manual ARES_SAVE_OPTIONS(3)
2
3
4
6 ares_save_options - Save configuration values obtained from initialized
7 ares_channel
8
10 #include <ares.h>
11
12 int ares_save_options(ares_channel channel,
13 struct ares_options *options, int *optmask)
14
16 The ares_save_options(3) function saves the channel data identified by
17 channel, into the options struct identified by options, and saves the
18 mask of options which are set to the integer pointer (passed by refer‐
19 ence) identified by optmask.
20
21 The resultant options and optmask are then able to be passed directly
22 to ares_init_options. When the options are no longer needed, ares_de‐
23 stroy_options should be called to free any associated memory.
24
26 ares_save_options(3) can return any of the following values:
27
28 ARES_SUCCESS The channel data was successfully stored
29
30 ARES_ENOMEM The memory was exhausted
31
32 ARES_ENODATA The channel data identified by channel were invalid.
33
35 Since c-ares 1.6.0 the ares_options struct has been "locked" meaning
36 that it won't be extended to cover new functions. This function will
37 remain functioning, but it can only return config data that can be rep‐
38 resented in this config struct, which may no longer be the complete set
39 of config options. ares_dup(3) will not have that restriction.
40
41 The ares_options struct can not handle potential IPv6 name servers the
42 ares_channel might be configured to use. The ares_save_options(3) func‐
43 tion will only return IPv4 servers, if any. In order to retrieve all
44 name servers an ares_channel might be using, the ares_get_servers(3)
45 function must be used instead.
46
48 ares_destroy_options(3), ares_init_options(3), ares_get_servers(3),
49 ares_dup(3)
50
52 ares_save_options(3) was added in c-ares 1.4.0
53
55 Brad House
56 Copyright 1998 by the Massachusetts Institute of Technology.
57
58
59
60 5 March 2010 ARES_SAVE_OPTIONS(3)