summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_epoll.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-01tevent: the content of event is ignored by EPOLL_CTL_DELStefan Metzmacher1-2/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: call epoll_panic() if EPOLL_CTL_DEL failedStefan Metzmacher1-4/+11
Only ENOENT is ignored as it is no error. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: use helper variables to hold the epoll_ctl() resultStefan Metzmacher1-3/+9
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: remove unused if (epoll_ev->epoll_fd == -1) return; checksStefan Metzmacher1-9/+0
We'll never leave epoll_check_reopen() with epoll_fd == -1. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: avoid any operation on epoll_ev after a epoll_panic()Stefan Metzmacher1-11/+74
This calls TALLOC_FREE(ev->additional_data), which is epoll_ev within epoll_panic() before calling the fallback handler. In order to notice that a epoll_panic() happened, a caller can register a pointer to a bool variable under epoll_ev->panic_state. As epoll_check_reopen() can fail due to a epoll_panic(), we need to force the replay flag if we have called any event handler. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: add epoll_{create,ctl}_panic_fallback() for testingStefan Metzmacher1-5/+49
This makes sure we only do random panics if a fallback handler is registered. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: remember the errno from select(), poll() and epoll_wait()Stefan Metzmacher1-2/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: fix a comment typo in tevent_epoll.cMichael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: Add in the same tevent_re_initialise() fix Metze put in the ↵Jeremy Allison1-0/+6
tevent_poll backend. We might be called during tevent_re_initialise() which means we need to free our old additional_data. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: Add in some test code to allow the panic fallback path to be tested.Jeremy Allison1-0/+18
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: Plumb in the panic fallback code into the epoll_panic() runtime call.Jeremy Allison1-3/+20
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: Add an internal function tevent_epoll_set_panic_fallback().Jeremy Allison1-0/+24
Can be set externally, allows us to fallback if epoll fails at runtime. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: pass 'bool replay' to epoll_panic()Stefan Metzmacher1-5/+6
A fallback panic handler will need to know if there was an error while waiting for events (replay=true) or if the error happened on modify (replay=false). Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: Ensure we return after every call to epoll_panic().Jeremy Allison1-0/+2
Currently we can't return from this, but the new fallback code will change this. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-06-08lib/tevent: Add trace point callbackMartin Schwenke1-0/+2
Set/get a single callback function to be invoked at various trace points. Define "before wait" and "after wait" trace points - more trace points can be added later if required. CTDB wants this to log long waits and events. Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Signed-off-by: Martin Schwenke <martin@meltin.net> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-08-11tevent: Set FD_CLOEXEC on epoll handleSumit Bose1-2/+17
If an application using libtevent starts a new process the epoll file descriptor is leaked to the new process if the event context is not freed explicitly. By setting FD_CLOEXEC this is not needed anymore. Signed-off-by: Simo Sorce <idra@samba.org>
2011-02-17tevent: Fix a commentVolker Lendecke1-2/+1
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Feb 17 18:16:18 CET 2011 on sn-devel-104
2010-04-18tevent: mark backend init fns as _PRIVATE_Andrew Tridgell1-1/+1
these are not supposed to be exposed in the library
2009-03-17tevent: add support for immediate eventsStefan Metzmacher1-11/+17
They're like directly triggered timed events, but you can preallocated them and scheduling them will not fail. metze
2009-03-17tevent: add tevent_common_loop_wait() helper function and use itStefan Metzmacher1-17/+1
tevent_loop_wait should do the same for all backends. It should loop as long as we have pending events. metze
2009-03-17tevent: check signal events first in event_loop_onceStefan Metzmacher1-0/+5
We also check for signal events directly before and after the select/epoll calls. metze
2009-03-17tevent: let tevent_loop_once() just run one fd eventStefan Metzmacher1-15/+2
This makes the logic much simpler for the callers, and matches the samba3 behavior. If needed we can add performance tunning for tevent_loop_wait() later. metze
2009-03-12tevent: pass __location__ to tevent_loop_once/wait()Stefan Metzmacher1-3/+3
metze
2009-02-17tevent: Rename ev_timeval* functions to tevent_timeval, export them.Kai Blin1-1/+1
Also add tevent_timeval_add() and tevent_timeval_current_ofs() to help not depending on lub/util/time.c for things that just need tevent
2009-02-16lib/tevent: change to LGPLv3+Stefan Metzmacher1-13/+17
metze
2009-01-05tevent: keep a linked list of fd_eventsStefan Metzmacher1-34/+13
metze
2009-01-05tevent: keep a linked list of signal eventsStefan Metzmacher1-2/+2
metze
2009-01-04tevent: completely initialize tevent_fd structsStefan Metzmacher1-0/+1
This fixes crash bugs... I forgot to commit and squash this to commit e45ed828d042acca09cb1ed5b6dd7a24eb5e7ffd metze
2009-01-03tevent: remove TEVENT_FD_AUTOCLOSE featureStefan Metzmacher1-3/+0
TEVENT_FD_AUTOCLOSE adds a dependency to SOCKET_WRAPPER, which is bad. Callers should use tevent_fd_set_close_fn() now. metze
2009-01-03tevent: remove dependency to SOCKET_WRAPPER via "system/network.h"Stefan Metzmacher1-1/+0
metze
2009-01-03tevent: add tevent_fd_set_close_fn()Stefan Metzmacher1-1/+5
Let callers specify a close function as an alternative to TEVENT_FD_AUTOCLOSE. metze
2009-01-03tevent: move some common tevent_fd related functions into tevent_fd.cStefan Metzmacher1-10/+1
metze
2009-01-02tevent: use TEVENT_FD_* instead of EVENT_FD_*Stefan Metzmacher1-12/+12
metze
2009-01-02tevent: rename ev_debug_ops => tevent_debug_opsStefan Metzmacher1-6/+6
And related changes, but we keep compat macros metze
2009-01-02tevent: pass down handler_name and location to the backend layerStefan Metzmacher1-9/+13
metze
2009-01-02tevent: rename event_register_backend() => tevent_register_backend()Stefan Metzmacher1-3/+3
And fix the callers and there init functions. metze
2009-01-02tevent: use libreplace headers instead of system headersStefan Metzmacher1-1/+1
metze
2008-12-29s4:lib/tevent: rename structsStefan Metzmacher1-21/+21
list="" list="$list event_context:tevent_context" list="$list fd_event:tevent_fd" list="$list timed_event:tevent_timer" for s in $list; do o=`echo $s | cut -d ':' -f1` n=`echo $s | cut -d ':' -f2` r=`git grep "struct $o" |cut -d ':' -f1 |sort -u` files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4` for f in $files; do cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp mv $f.tmp $f done done metze
2008-12-29lib/tevent: rename event_* => tevent_* in the header fileStefan Metzmacher1-1/+1
We have compat macros to keep the callers happy. metze
2008-12-17s4:lib/tevent: add lib/events/ compat and let things compileStefan Metzmacher1-3/+3
metze
2008-12-17s4:lib/events: move to toplevel directory as lib/tevent/Stefan Metzmacher1-0/+482
This commit will not compile on its own. metze