aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-06-30 13:34:47 -0700
committerGravatar GitHub <noreply@github.com>2016-06-30 13:34:47 -0700
commitace248931219ce913fd37e2fc063ea77101fecfd (patch)
treeace334f84363a52b2c40b3832dea9c84152ab1c1 /src/core/lib
parentdc733d69d8bac7f291ac59a724b609bd0b8bf25a (diff)
parent84d2e479b6ef4a4e20499fb003f9906f1c3c12ee (diff)
Merge pull request #7151 from dgquintas/eventfd
implemented eventfd_check_availability
Diffstat (limited to 'src/core/lib')
-rw-r--r--src/core/lib/iomgr/wakeup_fd_eventfd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/wakeup_fd_eventfd.c b/src/core/lib/iomgr/wakeup_fd_eventfd.c
index 667b4a5f90..95f6102330 100644
--- a/src/core/lib/iomgr/wakeup_fd_eventfd.c
+++ b/src/core/lib/iomgr/wakeup_fd_eventfd.c
@@ -84,8 +84,10 @@ static void eventfd_destroy(grpc_wakeup_fd* fd_info) {
}
static int eventfd_check_availability(void) {
- /* TODO(klempner): Actually check if eventfd is available */
- return 1;
+ const int efd = eventfd(0, 0);
+ const int is_available = efd >= 0;
+ if (is_available) close(efd);
+ return is_available;
}
const grpc_wakeup_fd_vtable grpc_specialized_wakeup_fd_vtable = {