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>
parent
06671a3cbd
commit
f25d6ad2aa
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue