diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2017-08-29 17:52:39 +0200 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2017-09-09 16:32:48 +0200 |
commit | f1a3e0c25a04fc84f3632c09d1f704be70c7fc58 (patch) | |
tree | 91e0408888f7f117e3cf1a41238e9c02738f0178 /third_party | |
parent | 1d93e22a10a03c79d6113e084b337bfd1db90821 (diff) |
add back manual edits to config_linux/ares_config.h
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/cares/config_linux/ares_config.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/third_party/cares/config_linux/ares_config.h b/third_party/cares/config_linux/ares_config.h index 45139c2163..065d0bc515 100644 --- a/third_party/cares/config_linux/ares_config.h +++ b/third_party/cares/config_linux/ares_config.h @@ -66,8 +66,15 @@ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T -/* Define to 1 if you have the clock_gettime function and monotonic timer. */ -#define HAVE_CLOCK_GETTIME_MONOTONIC +/* Define HAVE_CLOCK_GETTIME_MONOTONIC if you have the clock_gettime + * function and monotonic timer. + * + * IMPORTANT: gRPC MANUAL EDIT HERE! + * Note: setting HAVE_CLOCK_GETTIME_MONOTONIC causes use of the clock_gettime + * function from glibc, don't set it to support glibc < 2.17 */ +#ifndef GPR_BACKWARDS_COMPATIBILITY_MODE + #define HAVE_CLOCK_GETTIME_MONOTONIC +#endif /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ @@ -421,3 +428,31 @@ /* Type to use in place of in_addr_t when system does not provide it. */ #undef in_addr_t +#ifdef GPR_BACKWARDS_COMPATIBILITY_MODE + /* IMPORTANT: gRPC MANUAL EDIT HERE! + * Redefine the fd_set macros for GLIBC < 2.15 support. + * This is a backwards compatibility hack. At version 2.15, GLIBC introduces + * the __fdelt_chk function, and starts using it within its fd_set macros + * (which c-ares uses). For compatibility with GLIBC < 2.15, we need to redefine + * the fd_set macros to not use __fdelt_chk. */ + #include <sys/select.h> + #undef FD_SET + #undef FD_CLR + #undef FD_ISSET + /* 'FD_ZERO' doesn't use __fdelt_chk, no need to redefine. */ + + #ifdef __FDS_BITS + #define GRPC_CARES_FDS_BITS(set) __FDS_BITS(set) + #else + #define GRPC_CARES_FDS_BITS(set) ((set)->fds_bits) + #endif + + #define GRPC_CARES_FD_MASK(d) ((long int)(1UL << (d) % NFDBITS)) + + #define FD_SET(d, set) \ + ((void) (GRPC_CARES_FDS_BITS (set)[ (d) / NFDBITS ] |= GRPC_CARES_FD_MASK(d))) + #define FD_CLR(d, set) \ + ((void) (GRPC_CARES_FDS_BITS (set)[ (d) / NFDBITS ] &= ~GRPC_CARES_FD_MASK(d))) + #define FD_ISSET(d, set) \ + ((GRPC_CARES_FDS_BITS (set)[ (d) / NFDBITS ] & GRPC_CARES_FD_MASK(d)) != 0) +#endif /* GPR_BACKWARDS_COMPATIBILITY_MODE */ |