Eliminate GRPC_LINUX_LEGACY_EPOLL

Rename:

  GRPC_LINUX_LEGACY_EPOLL to GRPC_LINUX_EPOLL, and
  GRPC_LINUX_EPOLL to GRPC_LINUX_EPOLL_CREATE1
pull/14052/head
Mehrdad Afshari 7 years ago
parent 8b0e9fb17e
commit fb66900a9a
  1. 6
      src/core/lib/iomgr/ev_epoll1_linux.cc
  2. 10
      src/core/lib/iomgr/ev_epollex_linux.cc
  3. 10
      src/core/lib/iomgr/ev_epollsig_linux.cc
  4. 4
      src/core/lib/iomgr/ev_epollsig_linux.h
  5. 2
      src/core/lib/iomgr/is_epollexclusive_available.cc
  6. 6
      src/core/lib/iomgr/port.h
  7. 6
      test/core/iomgr/ev_epollsig_linux_test.cc
  8. 6
      test/core/iomgr/pollset_set_test.cc

@ -22,7 +22,7 @@
/* This polling engine is only relevant on linux kernels supporting epoll
epoll_create() or epoll_create1() */
#ifdef GRPC_LINUX_LEGACY_EPOLL
#ifdef GRPC_LINUX_EPOLL
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include <assert.h>
@ -1245,7 +1245,7 @@ const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) {
return &vtable;
}
#else /* defined(GRPC_LINUX_LEGACY_EPOLL) */
#else /* defined(GRPC_LINUX_EPOLL) */
#if defined(GRPC_POSIX_SOCKET)
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
/* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
@ -1254,4 +1254,4 @@ const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) {
return nullptr;
}
#endif /* defined(GRPC_POSIX_SOCKET) */
#endif /* !defined(GRPC_LINUX_LEGACY_EPOLL) */
#endif /* !defined(GRPC_LINUX_EPOLL) */

@ -21,7 +21,7 @@
#include <grpc/support/log.h>
/* This polling engine is only relevant on linux kernels supporting epoll() */
#ifdef GRPC_LINUX_EPOLL
#ifdef GRPC_LINUX_EPOLL_CREATE1
#include "src/core/lib/iomgr/ev_epollex_linux.h"
@ -1442,15 +1442,15 @@ const grpc_event_engine_vtable* grpc_init_epollex_linux(
return &vtable;
}
#else /* defined(GRPC_LINUX_EPOLL) */
#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */
#if defined(GRPC_POSIX_SOCKET)
#include "src/core/lib/iomgr/ev_epollex_linux.h"
/* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
* NULL */
/* If GRPC_LINUX_EPOLL_CREATE1 is not defined, it means
epoll_create1 is not available. Return NULL */
const grpc_event_engine_vtable* grpc_init_epollex_linux(
bool explicitly_requested) {
return nullptr;
}
#endif /* defined(GRPC_POSIX_SOCKET) */
#endif /* !defined(GRPC_LINUX_EPOLL) */
#endif /* !defined(GRPC_LINUX_EPOLL_CREATE1) */

@ -22,7 +22,7 @@
#include <grpc/support/log.h>
/* This polling engine is only relevant on linux kernels supporting epoll() */
#ifdef GRPC_LINUX_EPOLL
#ifdef GRPC_LINUX_EPOLL_CREATE1
#include "src/core/lib/iomgr/ev_epollsig_linux.h"
@ -1725,11 +1725,11 @@ const grpc_event_engine_vtable* grpc_init_epollsig_linux(
return &vtable;
}
#else /* defined(GRPC_LINUX_EPOLL) */
#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */
#if defined(GRPC_POSIX_SOCKET)
#include "src/core/lib/iomgr/ev_epollsig_linux.h"
/* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
* NULL */
/* If GRPC_LINUX_EPOLL_CREATE1 is not defined, it means
epoll_create1 is not available. Return NULL */
const grpc_event_engine_vtable* grpc_init_epollsig_linux(
bool explicit_request) {
return nullptr;
@ -1737,4 +1737,4 @@ const grpc_event_engine_vtable* grpc_init_epollsig_linux(
#endif /* defined(GRPC_POSIX_SOCKET) */
void grpc_use_signal(int signum) {}
#endif /* !defined(GRPC_LINUX_EPOLL) */
#endif /* !defined(GRPC_LINUX_EPOLL_CREATE1) */

@ -24,10 +24,10 @@
const grpc_event_engine_vtable* grpc_init_epollsig_linux(bool explicit_request);
#ifdef GRPC_LINUX_EPOLL
#ifdef GRPC_LINUX_EPOLL_CREATE1
void* grpc_fd_get_polling_island(grpc_fd* fd);
void* grpc_pollset_get_polling_island(grpc_pollset* ps);
bool grpc_are_polling_islands_equal(void* p, void* q);
#endif /* defined(GRPC_LINUX_EPOLL) */
#endif /* defined(GRPC_LINUX_EPOLL_CREATE1) */
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLSIG_LINUX_H */

@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/is_epollexclusive_available.h"
#ifdef GRPC_LINUX_EPOLL
#ifdef GRPC_LINUX_EPOLL_CREATE1
#include <grpc/support/log.h>

@ -37,7 +37,7 @@
#define GRPC_POSIX_SOCKETUTILS 1
#define GRPC_POSIX_WAKEUP_FD 1
#define GRPC_TIMER_USE_GENERIC 1
#define GRPC_LINUX_LEGACY_EPOLL 1
#define GRPC_LINUX_EPOLL 1
#elif defined(GPR_WINDOWS)
#define GRPC_TIMER_USE_GENERIC 1
#define GRPC_WINSOCK_SOCKET 1
@ -69,10 +69,9 @@
#define GRPC_TIMER_USE_GENERIC 1
#ifdef __GLIBC_PREREQ
#if __GLIBC_PREREQ(2, 4)
#define GRPC_LINUX_LEGACY_EPOLL 1
#define GRPC_LINUX_EPOLL 1
#endif
#if __GLIBC_PREREQ(2, 9)
#define GRPC_LINUX_EPOLL 1
#define GRPC_LINUX_EPOLL_CREATE1 1
#define GRPC_LINUX_EVENTFD 1
#endif
@ -82,6 +81,7 @@
#endif
#ifndef __GLIBC__
#define GRPC_LINUX_EPOLL 1
#define GRPC_LINUX_EPOLL_CREATE1 1
#define GRPC_LINUX_EVENTFD 1
#define GRPC_MSG_IOVLEN_TYPE int
#endif

@ -18,7 +18,7 @@
#include "src/core/lib/iomgr/port.h"
/* This test only relevant on linux systems where epoll() is available */
#ifdef GRPC_LINUX_EPOLL
#ifdef GRPC_LINUX_EPOLL_CREATE1
#include "src/core/lib/iomgr/ev_epollsig_linux.h"
#include "src/core/lib/iomgr/ev_posix.h"
@ -319,6 +319,6 @@ int main(int argc, char** argv) {
grpc_shutdown();
return 0;
}
#else /* defined(GRPC_LINUX_EPOLL) */
#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */
int main(int argc, char** argv) { return 0; }
#endif /* !defined(GRPC_LINUX_EPOLL) */
#endif /* !defined(GRPC_LINUX_EPOLL_CREATE1) */

@ -18,7 +18,7 @@
#include "src/core/lib/iomgr/port.h"
/* This test only relevant on linux systems where epoll is available */
#ifdef GRPC_LINUX_EPOLL
#ifdef GRPC_LINUX_EPOLL_CREATE1
#include <errno.h>
#include <string.h>
@ -443,6 +443,6 @@ int main(int argc, char** argv) {
grpc_shutdown();
return 0;
}
#else /* defined(GRPC_LINUX_EPOLL) */
#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */
int main(int argc, char** argv) { return 0; }
#endif /* !defined(GRPC_LINUX_EPOLL) */
#endif /* !defined(GRPC_LINUX_EPOLL_CREATE1) */

Loading…
Cancel
Save