Skip to content

Commit

Permalink
Merge pull request grpc#7151 from dgquintas/eventfd
Browse files Browse the repository at this point in the history
implemented eventfd_check_availability
  • Loading branch information
jtattermusch authored Jun 30, 2016
2 parents dc733d6 + 84d2e47 commit ace2489
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/lib/iomgr/wakeup_fd_eventfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit ace2489

Please sign in to comment.