aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2017-07-06 10:15:11 -0700
committerGravatar murgatroid99 <mlumish@google.com>2017-07-06 10:15:11 -0700
commit882ba60fcb2cdec28c7d3a2a74914f3a2eeba8e9 (patch)
tree03e2251852bf9cc3fafdc7b20cbaf35e1a2f8d52 /third_party
parent9796c8a31af5b91e4c98281a0a6cd768d52d5e77 (diff)
parent9780f9364664a359ebf6f5fc11dda7782785c20c (diff)
Merge remote-tracking branch 'upstream/v1.4.x' into master_1.4.1_upmerge
Diffstat (limited to 'third_party')
-rw-r--r--third_party/cares/config_linux/ares_config.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/third_party/cares/config_linux/ares_config.h b/third_party/cares/config_linux/ares_config.h
index 265974cfae..8c1b954327 100644
--- a/third_party/cares/config_linux/ares_config.h
+++ b/third_party/cares/config_linux/ares_config.h
@@ -70,8 +70,14 @@
/* Define to 1 if bool is an available type. */
#define HAVE_BOOL_T 1
-/* Define to 1 if you have the clock_gettime function and monotonic timer. */
-#define HAVE_CLOCK_GETTIME_MONOTONIC 1
+/* Define HAVE_CLOCK_GETTIME_MONOTONIC to 1 if you have the clock_gettime
+ * function and monotonic timer.
+ *
+ * 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 1
+#endif
/* Define to 1 if you have the closesocket function. */
/* #undef HAVE_CLOSESOCKET */
@@ -505,6 +511,34 @@
# define _DARWIN_USE_64_BIT_INODE 1
#endif
+#ifdef GPR_BACKWARDS_COMPATIBILITY_MODE
+ /* 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 */
+
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */