3 .\" Copyright 1998 by Daniel Stenberg
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_GETSOCK 3 "22 December 2005"
19 ares_getsock \- get file descriptors to wait on
24 .B int ares_getsock(ares_channel \fIchannel\fP, int *\fIsocks\fP,
25 .B int \fInumsocks\fP);
30 function retrieves the set of file descriptors which the calling
31 application should wait on for reading and/or writing for the
32 processing of name service queries pending on the name service channel
35 File descriptors will be set in the integer array pointed to by
37 \fInumsocks\fP is the size of the given array in number of ints.
39 This function can only return information about up to 16 sockets. If more are
40 in use (however unlikely that is), they are simply not reported back.
42 \fBares_getsock\fP returns a bitmask for what actions to wait for on the
43 different sockets. The ares.h header file provides these convenience macros to
44 extract the information appropriately:
47 #define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about
49 #define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
50 #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
51 ARES_GETSOCK_MAXNUM)))