From 1957fd0a84c674676e155665d8d26588f8e03309 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 16 Jan 2018 17:22:01 -0800 Subject: Enable epoll on Python manylinux1 The Python packages built for Linux and uploaded to PyPI are required to target a standardized platform specification dubbed `manylinux1`, which tries to cover a vast array of Linux distributions, thereby emulating a legacy lowest-common-denominator distribution, with an old `glibc` that does not support `epoll_create1`, but provides the `epoll_create` interface. While there are race condition risks associated with utilizing the latter interface and setting the `O_CLOEXEC` flag immediately on the file descriptor returned by `epoll_create`, the payoff is well worth the risks for our Python users, who currently end up falling back on `poll` polling engine when downloading our Linux binary packages. --- src/core/lib/iomgr/port.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/core/lib/iomgr/port.h') diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h index 9fae8c0052..80867ee09f 100644 --- a/src/core/lib/iomgr/port.h +++ b/src/core/lib/iomgr/port.h @@ -67,8 +67,11 @@ #define GRPC_POSIX_WAKEUP_FD 1 #define GRPC_TIMER_USE_GENERIC 1 #ifdef __GLIBC_PREREQ -#if __GLIBC_PREREQ(2, 9) +#if __GLIBC_PREREQ(2, 4) #define GRPC_LINUX_EPOLL 1 +#endif +#if __GLIBC_PREREQ(2, 9) +#define GRPC_LINUX_EPOLL_CREATE1 1 #define GRPC_LINUX_EVENTFD 1 #endif #if __GLIBC_PREREQ(2, 10) -- cgit v1.2.3