aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-12 16:07:28 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-12 16:07:28 -0800
commit6b6c3dd2c919856292c71fbddc03a5feeed0c766 (patch)
tree5c34cbc91f31dda9c65292de598f4f5337b46b96
parent9b09d19484c21f72eb8f1b26ad1bd63715896ee7 (diff)
parentd3ae976ac0ed4af3aba93ac31081cf2e28a03ccd (diff)
Merge pull request #500 from nicolasnoble/secure_getenv
Not all Linuxes are equal, and secure_getenv isn't always there.
-rw-r--r--include/grpc/support/port_platform.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h
index 9d4bfbee5e..fbaefe6d09 100644
--- a/include/grpc/support/port_platform.h
+++ b/include/grpc/support/port_platform.h
@@ -70,6 +70,7 @@
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
#elif defined(__linux__)
+#include <features.h>
#define GPR_CPU_LINUX 1
#define GPR_GCC_ATOMIC 1
#define GPR_LINUX 1
@@ -78,7 +79,14 @@
#define GPR_LINUX_EVENTFD 1
#define GPR_POSIX_SOCKET 1
#define GPR_POSIX_SOCKETADDR 1
+#ifdef __GLIBC_PREREQ
+#if __GLIBC_PREREQ(2, 17)
#define GPR_LINUX_ENV 1
+#endif
+#endif
+#ifndef GPR_LINUX_ENV
+#define GPR_POSIX_ENV 1
+#endif
#define GPR_POSIX_FILE 1
#define GPR_POSIX_STRING 1
#define GPR_POSIX_SYNC 1