diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-20 23:48:02 +0900 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2015-04-01 14:44:42 +0000 |
commit | f25d6ad2aa4c7e4c4884dd469c631fafd207ef8f (patch) | |
tree | 8e18985c2b616c89023494950f35070b7beb9613 /src/3rdparty/forkfd | |
parent | 06671a3cbda8b74b350eb14c0fbc23c0a63a7c64 (diff) |
forkfd: Fix compilation with older glibc
glibc 2.9 is required for pipe2 and version 2.7 for eventfd.
Bionic added them to Android version 2.3.1, but I can't find a version
macro.
uclibc masquerades as glibc version 2.2, so this function won't be
thread-safe with uclibc.
Change-Id: Iee8cbc07c4434ce9b560ffff13cd3c3b63dd7e83
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/3rdparty/forkfd')
-rw-r--r-- | src/3rdparty/forkfd/forkfd.c | 10 |
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 |