From: Alan T. DeKok Date: Wed, 23 Nov 2016 20:52:24 +0000 (-0500) Subject: add function to export the kqueue X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d43007beef548c3e144144cc7f174cd6fd7fe9b;p=thirdparty%2Ffreeradius-server.git add function to export the kqueue --- diff --git a/src/include/event.h b/src/include/event.h index e9449e2bfee..b7b14ae1f13 100644 --- a/src/include/event.h +++ b/src/include/event.h @@ -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); diff --git a/src/lib/event.c b/src/lib/event.c index c9f77a2d712..bbb3d5e7fc3 100644 --- a/src/lib/event.c +++ b/src/lib/event.c @@ -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