]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add function to export the kqueue
authorAlan T. DeKok <aland@freeradius.org>
Wed, 23 Nov 2016 20:52:24 +0000 (15:52 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 24 Nov 2016 23:14:07 +0000 (18:14 -0500)
src/include/event.h
src/lib/event.c

index e9449e2bfeec59b8a0acded62fa06b03fc53a6be..b7b14ae1f136927dd445f748b83f7afa73e9a91a 100644 (file)
@@ -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);
index c9f77a2d712ac92798350e8f867b16d22c78878f..bbb3d5e7fc35a612e621e54e9926e8dd00b59644 100644 (file)
@@ -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