Skip to content

Commit

Permalink
add function to export the kqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Nov 24, 2016
1 parent 86046a6 commit 2d43007
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ typedef void (*fr_event_user_handler_t)(int kq, struct kevent const *kev, void *

int fr_event_list_num_fds(fr_event_list_t *el);
int fr_event_list_num_elements(fr_event_list_t *el);
int fr_event_list_kq(fr_event_list_t *el);
int fr_event_list_time(struct timeval *when, fr_event_list_t *el);

int fr_event_fd_delete(fr_event_list_t *el, int fd);
Expand Down
12 changes: 12 additions & 0 deletions src/lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ int fr_event_list_num_elements(fr_event_list_t *el)
return fr_heap_num_elements(el->times);
}

/** Return the kq associated with an event list.
*
* @param[in] el to return timer events for.
* @return kq
*/
int fr_event_list_kq(fr_event_list_t *el)
{
if (!el) return -1;

return el->kq;
}

/** Get the current time according to the event list
*
* If the event list is currently dispatching events, we return the time
Expand Down

0 comments on commit 2d43007

Please sign in to comment.