From 6eda79d02d3f73d79ecd78cf18aba053973a9652 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Feb 2014 09:54:28 +0100 Subject: [PATCH] system/EPollFD: add epoll_create1() fallback for Android --- src/system/EPollFD.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/system/EPollFD.cxx b/src/system/EPollFD.cxx index 16787a50b..43e74712f 100644 --- a/src/system/EPollFD.cxx +++ b/src/system/EPollFD.cxx @@ -22,6 +22,21 @@ #include "EPollFD.hxx" #include "FatalError.hxx" +#ifdef __BIONIC__ + +#include +#include + +#define EPOLL_CLOEXEC O_CLOEXEC + +static inline int +epoll_create1(int flags) +{ + return syscall(__NR_epoll_create1, flags); +} + +#endif + EPollFD::EPollFD() :fd(::epoll_create1(EPOLL_CLOEXEC)) {