diff options
author | Jeremy Allison <jra@samba.org> | 2013-02-11 11:20:28 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-02-14 10:19:38 -0800 |
commit | 203f85c25eb9238eae8e4dc5b55b549294b0fa03 (patch) | |
tree | b61556942afd6216adf2668ca99f4e73d08bd3b6 /lib | |
parent | 5fe459f5d7c0e6b5eeeb1aa2c8248e174a31008f (diff) | |
download | samba-203f85c25eb9238eae8e4dc5b55b549294b0fa03.tar.gz samba-203f85c25eb9238eae8e4dc5b55b549294b0fa03.tar.bz2 samba-203f85c25eb9238eae8e4dc5b55b549294b0fa03.zip |
tevent: Add a private function tevent_poll_event_add_fd_internal().
Not yet used, but will be called by the "standard"
fallback from epoll -> poll backends.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tevent/tevent_internal.h | 3 | ||||
-rw-r--r-- | lib/tevent/tevent_poll.c | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h index fa6652cfa1..8433333558 100644 --- a/lib/tevent/tevent_internal.h +++ b/lib/tevent/tevent_internal.h @@ -316,6 +316,8 @@ void tevent_cleanup_pending_signal_handlers(struct tevent_signal *se); bool tevent_standard_init(void); bool tevent_select_init(void); bool tevent_poll_init(void); +void tevent_poll_event_add_fd_internal(struct tevent_context *ev, + struct tevent_fd *fde); bool tevent_poll_mt_init(void); #ifdef HAVE_EPOLL bool tevent_epoll_init(void); @@ -324,5 +326,6 @@ bool tevent_epoll_set_panic_fallback(struct tevent_context *ev, bool replay)); #endif + void tevent_trace_point_callback(struct tevent_context *ev, enum tevent_trace_point); diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c index 5479f2f7cd..89b3bbc0b3 100644 --- a/lib/tevent/tevent_poll.c +++ b/lib/tevent/tevent_poll.c @@ -256,6 +256,22 @@ static void poll_event_schedule_immediate(struct tevent_immediate *im, } /* + Private function called by "standard" backend fallback. + Note this only allows fallback to "poll" backend, not "poll-mt". +*/ +_PRIVATE_ void tevent_poll_event_add_fd_internal(struct tevent_context *ev, + struct tevent_fd *fde) +{ + struct poll_event_context *poll_ev = talloc_get_type_abort( + ev->additional_data, struct poll_event_context); + + fde->additional_flags = UINT64_MAX; + fde->additional_data = NULL; + DLIST_ADD(poll_ev->fresh, fde); + talloc_set_destructor(fde, poll_fresh_fde_destructor); +} + +/* add a fd based event return NULL on failure (memory allocation error) */ |