From 84d2e479b6ef4a4e20499fb003f9906f1c3c12ee Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 29 Jun 2016 14:53:46 -0700 Subject: implemented eventfd_check_availability --- src/core/lib/iomgr/wakeup_fd_eventfd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/lib/iomgr') 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 = { -- cgit v1.2.3