summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/forkfd/forkfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/forkfd/forkfd.c')
-rw-r--r--src/3rdparty/forkfd/forkfd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c
index 5710608d6d..017ae0741e 100644
--- a/src/3rdparty/forkfd/forkfd.c
+++ b/src/3rdparty/forkfd/forkfd.c
@@ -41,9 +41,13 @@
#include <unistd.h>
#ifdef __linux__
-# define HAVE_PIPE2 1
-# define HAVE_EVENTFD 1
-# include <sys/eventfd.h>
+# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x207) || defined(__BIONIC__)
+# include <sys/eventfd.h>
+# define HAVE_EVENTFD 1
+# endif
+# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x209) || defined(__BIONIC__)
+# define HAVE_PIPE2 1
+# endif
#endif
#if _POSIX_VERSION-0 >= 200809L || _XOPEN_VERSION-0 >= 500