1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

542 Commits

Author SHA1 Message Date
Jeremy Allison
203f85c25e 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>
2013-02-14 10:19:38 -08:00
Stefan Metzmacher
5fe459f5d7 tevent: make use of tevent_find_ops_byname() in tevent_context_init_byname()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-02-14 10:19:38 -08:00
Stefan Metzmacher
b5556a79e3 tevent: make sure tevent_backend_init() only runs once
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-02-14 10:19:38 -08:00
Jeremy Allison
aceeb585cb tevent: Add a utility function tevent_find_ops_byname().
Returns an event ops struct given a string name. Not
yet used, but will be part of the new "standard" fallback
code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14 10:19:38 -08:00
Jeremy Allison
1ee428d5ca tevent: Add in the same tevent_re_initialise() fix Metze put in the 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-14 10:19:38 -08:00
Jeremy Allison
06fb88b449 tevent: Add in some test code to allow the panic fallback path to be tested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14 10:19:38 -08:00
Jeremy Allison
6f9819229b tevent: Plumb in the panic fallback code into the epoll_panic() runtime call.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14 10:19:38 -08:00
Jeremy Allison
04ba47e491 tevent: Add an internal function tevent_epoll_set_panic_fallback().
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-14 10:19:38 -08:00
Stefan Metzmacher
e4ef2ecf02 tevent: pass 'bool replay' to epoll_panic()
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-14 10:19:38 -08:00
Jeremy Allison
129da06d2d tevent: Ensure we return after every call to epoll_panic().
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>
2013-02-14 10:19:38 -08:00
Jeremy Allison
c36f8c1400 tevent: Preparing to fix "standard" backend fallback. Initialize standard after epoll.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14 10:19:38 -08:00
Stefan Metzmacher
570a4b3e22 tevent_poll: add poll_event_loop_wait()
We can't use tevent_common_loop_wait() because new fd events
will be added to the poll_ev->fresh list instead of
ev->fd_events.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Feb  3 06:40:09 CET 2013 on sn-devel-104
2013-02-03 06:40:09 +01:00
Stefan Metzmacher
e79ad7cff1 tevent_poll: fix the usage of tevent_re_initialise()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:54:05 -08:00
Stefan Metzmacher
dd9f0c9b6d tevent_poll: call tevent_common_fd_destructor() from poll_fresh_fde_destructor()
We need to trigger the fde->close_fn().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:53:47 -08:00
Volker Lendecke
1cfc76f72a tevent_poll: Avoid a crash in poll_event_set_fd_flags
The event context might have been freed before the fde

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:53:30 -08:00
Volker Lendecke
611fcca641 tevent_poll: Avoid a crash in poll_fresh_fde_destructor
The event context might have been freed before the fde

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:53:12 -08:00
Volker Lendecke
0cf62a92f2 tevent_poll: NULL out fde->event_ctx for "fresh" poll fdes
This is done in tevent_common_context_destructor for the non-fresh
fdes already

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:52:57 -08:00
Volker Lendecke
3ce58cbcf3 tevent_poll: Use the poll_event_context_destructor always
This is in preparation for the next patch to NULL out the event_ctx
pointers in the poll_ev->fresh list

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:52:40 -08:00
Volker Lendecke
e3309852f7 tevent_poll: Re-order routines
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:52:21 -08:00
Volker Lendecke
d944e2cae1 tevent_poll: Fix a crash in the poll backend
If tevent_add_fd is immediately followed by tevent_fd_set_flags, the poll
backend crashes. This was introduced when the poll backend was prepared
for the multi-threaded python extension.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-02 19:52:09 -08:00
Volker Lendecke
dc929ca57f tevent: Fix a comment typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>

Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Thu Jan 31 17:52:39 CET 2013 on sn-devel-104
2013-01-31 17:52:39 +01:00
Volker Lendecke
7a21f605c1 tevent: Fix a comment
liboop.org is now in a language I don't understand. But it does definitely not
contain a library.

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 18 00:05:37 CET 2013 on sn-devel-104
2013-01-18 00:05:37 +01:00
Jeremy Allison
8f8ca589d2 tevent: Fix bug 9550 - sigprocmask does not work on FreeBSD to stop further signals in a signal handler
Mask off signals the correct way from the signal handler.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 15 12:13:43 CET 2013 on sn-devel-104
2013-01-15 12:13:43 +01:00
Stefan Metzmacher
d7d8646e63 tevent: change version to 0.9.17 after adding the "poll_mt" backend
metze
2012-08-16 21:10:32 +02:00
Volker Lendecke
d7af2c842a tevent: Add threaded poll_mt testcase
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 20:52:17 +02:00
Volker Lendecke
fa71f32411 lib/tevent: Add a thread-safe tevent backend
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 20:49:11 +02:00
Volker Lendecke
d860aa2cac tevent_poll: Decouple poll_ev->fds handling from adding/removing fds
Step 1 in a python backend for multiple threads

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-08-16 20:48:32 +02:00
Andreas Schneider
41cffa3c8b doc: Remove build/ from doxygen config or it will not work in brew.
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Sat Aug  4 16:31:22 CEST 2012 on sn-devel-104
2012-08-04 16:31:22 +02:00
Volker Lendecke
c03e9769cd tevent: Refer to the correct header in testsuite.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-07-31 11:40:22 +02:00
Stefan Metzmacher
b725154fe7 tevent: change version to 0.9.16
This adds tevent_*_trace_*() and tevent_context_init_ops()

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun  8 20:47:41 CEST 2012 on sn-devel-104
2012-06-08 20:47:40 +02:00
Stefan Metzmacher
ba65400c6e tevent: expose tevent_context_init_ops
This can be used to implement wrapper backends,
while passing a private pointer to the backens init function
via ev->additional_data.

metze
2012-06-08 19:00:05 +02:00
Martin Schwenke
796acbd9ff lib/tevent: Add trace point callback
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>
2012-06-08 19:00:05 +02:00
Martin Schwenke
653cb76edf lib/tevent: In poll_event_context, add a pointer back to the tevent_context
This makes it consistent with the other backends.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-08 19:00:01 +02:00
Andrew Bartlett
8ddd2a869b build: Remove unused release scripts for tevent
These now use waf dist, and the script/librelease.sh script as a wrapper.

The mksyms.sh call in the source3/Makefile uses the copy in source3/script

Andrew Bartlett
2012-05-30 04:15:11 +02:00
Stefan Metzmacher
e05b54ea32 lib/tevent/testsuite: no longer use 'compat' symbols
metze
2012-05-14 15:12:33 +02:00
Michael Adam
3583922c82 tevent: fix indentation in the wscript
(accidentially commited in 5e8dee8d96)
2012-05-13 22:41:48 +02:00
Volker Lendecke
670e85fde6 tevent: Fix a typo 2012-04-09 18:05:02 +02:00
Jelmer Vernooij
4c292c8e62 tevent: Install tevent.py into PYTHONARCHDIR rather than PYTHONDIR for consistency with other Samba scripts. 2012-03-10 21:31:52 +01:00
Volker Lendecke
9e25361203 tevent_signal: Fix a valgrind error
This fixes an uninitialized read introduced by my fix for the tevent_signal
destructors. From looking at the code you might believe that this kicks in only
when talloc failed. But with -O3 I do see it in normal operations.

Sorry for that.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Feb 15 17:58:37 CET 2012 on sn-devel-104
2012-02-15 17:58:36 +01:00
Stefan Metzmacher
de53fcd8de tevent: change the version to 0.9.15
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Feb  9 12:24:19 CET 2012 on sn-devel-104
2012-02-09 12:24:19 +01:00
Volker Lendecke
b5436fde5b tevent: Fix deleting signal events from within themselves
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-02-09 10:15:27 +01:00
Amitay Isaacs
2343703985 tevent: Fix python documentation strings
Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Tue Jan 31 16:59:29 CET 2012 on sn-devel-104
2012-01-31 16:59:29 +01:00
Volker Lendecke
092f1b9744 tevent: tevent_schedule_immediate never fails
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Dec  9 16:47:23 CET 2011 on sn-devel-104
2011-12-09 16:47:23 +01:00
Jelmer Vernooij
fbfd155a32 Add version attribute for pytevent.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Wed Dec  7 15:07:49 CET 2011 on sn-devel-104
2011-12-07 15:07:48 +01:00
Jelmer Vernooij
817f7529d3 tevent: Install python tevent modules.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Dec  6 23:13:37 CET 2011 on sn-devel-104
2011-12-06 23:13:37 +01:00
Jelmer Vernooij
5d1922739e Add stub python module for tevent. 2011-12-06 21:03:21 +01:00
Jelmer Vernooij
0ebc501fa8 tevent: Fix typo in build script.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec  3 02:15:40 CET 2011 on sn-devel-104
2011-12-03 02:15:40 +01:00
Jelmer Vernooij
86afe83d86 waf: Factor checking for undefined symbol flags out into separate method.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Nov 13 19:38:38 CET 2011 on sn-devel-104
2011-11-13 19:38:38 +01:00
Jelmer Vernooij
b929cd2c09 tevent: Only check for pkg-config file when checking for system tevent. 2011-11-13 18:06:06 +01:00
Jelmer Vernooij
5e8dee8d96 tevent: Only build pytevent if the system doesn't provide it. 2011-11-13 18:06:06 +01:00
Jelmer Vernooij
011707dee8 tevent: remove unnecessary enablement. 2011-11-13 18:06:06 +01:00
Martin Schwenke
538748132f Fix -Wunused-but-set-variable compiler warnings in tevent_signal.c
The results of some read(2) and write(2) calls are assigned into a
variable that is never used.  Presumably this used to avoid compiler
warnings or similar.

However, from (approximately) GCC 4.6 this produces some warnings:

  [ 609/3910] Compiling lib/tevent/tevent_signal.c
  ../lib/tevent/tevent_signal.c: In function ‘tevent_common_signal_handler’:
  ../lib/tevent/tevent_signal.c:85:10: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
  ../lib/tevent/tevent_signal.c: In function ‘signal_pipe_handler’:
  ../lib/tevent/tevent_signal.c:183:10: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]

The simplest thing to do is remove the variables and cast the function
return to void.  There is already a comment above each call.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-11-10 10:28:44 +01:00
Jelmer Vernooij
31912781ca wafsamba: Only install .pc files if libraries are public. 2011-08-21 03:22:05 +02:00
Andrew Tridgell
4aba775219 tevent: don't force the nesting flag to false in the destructor
the tevent destructor is called in tevent_re_initialise(), to reset
the event context back to its original state for creating child
processes. We need the nesting flag to stay the same

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Aug 12 05:18:25 CEST 2011 on sn-devel-104
2011-08-12 05:18:25 +02:00
Sumit Bose
ce93b4f464 tevent: fix documentation for tevent_context_init_byname()
Signed-off-by: Simo Sorce <idra@samba.org>

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Thu Aug 11 21:56:37 CEST 2011 on sn-devel-104
2011-08-11 21:56:37 +02:00
Sumit Bose
158b208dfd tevent: Set FD_CLOEXEC on epoll handle
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-08-11 14:38:53 -04:00
Simo Sorce
74f3e52f00 tevent: cleanup nesting counter when doing a full reinit.
We may be forking from within a loop, so we need to clean-up to avoid
aborts when nesting is not allowed and we are in a new children.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Stefan Metzmacher
fd3382906a tevent: change the version to 0.9.14 after the tevent_queue changes
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Aug  9 23:02:17 CEST 2011 on sn-devel-104
2011-08-09 23:02:17 +02:00
Stefan Metzmacher
c6363bb352 tevent: fix some comments in tevent.h
metze
2011-08-09 21:37:42 +02:00
Stefan Metzmacher
1533f1722d tevent: add tevent_queue_add_entry() and tevent_queue_add_optimize_empty()
This adds more flexible handling for the add operation:

- It allows the caller to remove a tevent_req from the queue
  by calling talloc_free() on the returned tevent_queue_entry.
- It allows the caller to optimize for the empty queue case,
  where it the caller wants to avoid the delay caused by
  the immediate event.

metze
2011-08-09 21:37:41 +02:00
Stefan Metzmacher
6b7d58cb4e tevent: splitout tevent_queue_add_internal() from tevent_queue_add()
metze
2011-08-09 21:37:41 +02:00
Stefan Metzmacher
aba9d48f55 tevent: allow tevent_queue_add() to take a NULL trigger function
This way the caller can add a blocker to the queue.

metze
2011-08-09 21:37:41 +02:00
Stefan Metzmacher
3c38ec72e7 tevent: add tevent_queue_running() function
metze
2011-08-09 21:37:40 +02:00
Jeremy Allison
0c67efdd68 Fix bug 7462 - Non-standard SA_RESETHAND is used in ...lib/tevent/tevent_signal.c
Make SA_RESETHAND conditional on its existance.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Aug  1 22:03:45 CEST 2011 on sn-devel-104
2011-08-01 22:03:45 +02:00
Volker Lendecke
83740555ea tevent: Slightly simplify poll_event_loop_poll
No real code change. Do an early return instead of an if-statement, avoiding
one level of indentation.
2011-07-28 17:42:23 +02:00
Stefan Metzmacher
4768fc6704 tevent: change version to 0.9.13 after adding tevent_req_defer_callback()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Jul  9 12:16:44 CEST 2011 on sn-devel-104
2011-07-09 12:16:44 +02:00
Stefan Metzmacher
e5827a4007 tevent: add tevent_req_defer_callback()
metze
2011-07-09 11:02:42 +02:00
Stefan Metzmacher
2a1ebeae19 tevent: fix comments for tevent_req_post()
metze
2011-07-09 11:02:41 +02:00
Volker Lendecke
8e1b9640e7 tevent: change version to 0.9.12 2011-06-20 12:33:24 +02:00
Volker Lendecke
c2a826b10c tevent: Add tevent_req_oom
This is a replacement for tevent_req_nomem(NULL, req)
2011-06-20 12:33:24 +02:00
Jeremy Allison
dbcdf3e39c Fix the poll() backend to correctly respond to POLLHUP|POLLERR returns on a fd selected for TEVENT_FD_WRITE only.
Don't trigger the write handler and remove the POLLOUT flag for this fd. Report errors on TEVENT_FD_READ requests only.
Metze please check !

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jun  3 22:53:52 CEST 2011 on sn-devel-104
2011-06-03 22:53:52 +02:00
Rusty Russell
e340cd83f8 lib/tevent/tevent.h: minor documentation fix.
The usecs arguments are (of course) microseconds, not milliseconds.
This was added by Andreas Schneider in 6c1bcdc2 (tevent: Document the
tevent helper functions.).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Jun  1 11:47:38 CEST 2011 on sn-devel-104
2011-06-01 11:47:38 +02:00
Volker Lendecke
8aab926c28 tevent: Fix a typo
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon May  9 08:17:08 CEST 2011 on sn-devel-104
2011-05-09 08:17:08 +02:00
Jelmer Vernooij
bf3b2e2aee Support the 'PYTHON' environment variable.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Apr 23 04:19:05 CEST 2011 on sn-devel-104
2011-04-23 04:19:04 +02:00
Jelmer Vernooij
df0b7f1c34 lib/: Fix prototypes for functions. 2011-03-19 03:20:05 +01:00
Andrew Tridgell
c56e3ccfc9 lib: don't install public headers if a private library
for talloc/tevent/tdb, only install headers if we are doing a
standalone build
2011-03-15 12:22:20 +11:00
Andrew Tridgell
a18a556237 tevent: use public_headers for tevent.h 2011-03-15 12:22:18 +11:00
Stefan Metzmacher
494d497b99 tevent: change version to 0.9.11
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Mar 10 10:24:49 CET 2011 on sn-devel-104
2011-03-10 10:24:49 +01:00
Stefan Metzmacher
b7d5ddfa61 tevent/poll: use fde->additional_flags to hold the array index
metze
2011-03-10 09:37:02 +01:00
Stefan Metzmacher
20284f2a84 tevent: change tevent_fd->additional_flags to uint64_t
metze
2011-03-10 09:37:02 +01:00
Andreas Schneider
d4867ef838 tevent: Fixed tevent_wakeup_send code example. 2011-03-09 09:28:27 +01:00
Jeremy Allison
410f9fad6c Fix "cast from pointer to integer of different size" warnings on a 64-bit machine. 2011-02-28 21:58:20 +01:00
Jelmer Vernooij
1a6fd61a41 tevent: Add lib/tevent as include directory. 2011-02-28 21:11:21 +01:00
Jeremy Allison
6e66208f63 Finish the range checking on all FD_SET calls for select().
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Feb 28 21:10:08 CET 2011 on sn-devel-104
2011-02-28 21:10:08 +01:00
Volker Lendecke
3254e39220 tevent: Add a poll backend 2011-02-28 16:40:20 +01:00
Volker Lendecke
7720facd42 tevent: Fix a comment
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Feb 17 18:16:18 CET 2011 on sn-devel-104
2011-02-17 18:16:18 +01:00
Stephen Gallagher
d6a41c2723 Return NULL if tevent_add_fd() is passed a negative fd
Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Mon Feb 14 17:47:03 CET 2011 on sn-devel-104
2011-02-14 17:47:03 +01:00
Volker Lendecke
dcd6764dad tevent: Fix typos
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Feb  9 18:13:18 CET 2011 on sn-devel-104
2011-02-09 18:13:18 +01:00
Andrew Tridgell
8b8caac6d0 build: removed the old autogen.sh and autogen-waf.sh scripts
for the builds that use waf only, these are no longer needed and just
cause confusion

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-07 15:03:40 +11:00
Andrew Tridgell
005c6370cd waf: ensure "make dist" works from a clean git tree for all libraries
this uses a temporary waf lock file to force the build directory

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sat Jan  8 02:35:22 CET 2011 on sn-devel-104
2011-01-08 02:35:22 +01:00
Jelmer Vernooij
51239bb26a talloc/tdb/tevent: Remove obsolete signatures files. 2011-01-01 02:54:05 +01:00
Volker Lendecke
b2c983149c tevent: More documentation updates
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Dec 26 15:49:59 CET 2010 on sn-devel-104
2010-12-26 15:49:59 +01:00
Volker Lendecke
d2de01f95b tevent: More doc fixes
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Dec 26 10:20:51 CET 2010 on sn-devel-104
2010-12-26 10:20:51 +01:00
Volker Lendecke
f16740a408 tevent: Some documentation fixes
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Dec 25 23:58:20 CET 2010 on sn-devel-104
2010-12-25 23:58:20 +01:00
Volker Lendecke
5353eaea33 tevent: Fix a typo
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Dec 25 22:56:18 CET 2010 on sn-devel-104
2010-12-25 22:56:18 +01:00
Stefan Metzmacher
42b7827021 tevent: add ABI/tevent-0.9.10.sigs
metze
2010-12-23 19:19:57 +01:00
Jelmer Vernooij
58206fb9b8 tevent: Remove reference to nonexistant configure.developer from autogen.sh.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Dec 21 20:29:21 CET 2010 on sn-devel-104
2010-12-21 20:29:21 +01:00
Jelmer Vernooij
e8790b93f2 tevent: Bump version number after symbol versioning changes. 2010-12-21 19:43:04 +01:00
Jelmer Vernooij
35fbc7bbda s4-smbtorture: Make test names lowercase and dot-separated.
This is consistent with the test names used by selftest, should
make the names less confusing and easier to integrate with other tools.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
2010-12-11 04:16:13 +01:00
Matthieu Patou
8733738357 build: introduce SAMBA_CHECK_PYTHON_HEADERS
This function is a wrapper around waf's check_python_header.
It avoids searching more than once for the headers bringing a small
speed improvement and a better lisibility of the logs.

But it's mainly to avoid a nasty bug when python libraries are in path
pointed by python_LIBPL (ie. /usr/local/lib/python2.6/config/) instead
of python_LIBDIR (ie. /usr/local/lib).

On the first call waf will correctly find that in order to link with
python libs it needs to add -L$python_LIBPL.

But on the next calls of check_python_headers, waf will use both the
current library path value (ie. -L/usr/local/lib/python2.6/config) and
-L$python_LIBDIR (ie. /usr/local/lib/) which will make him beleive that
python libraries are in $python_LIBDIR which at the end will make the
final link test fails in check_python_headers as it will not use the
good directory.

So by avoiding calling check_python_headers more than once we avoid
making waf fooling itself.
2010-12-10 02:07:18 +03:00
Andrew Tridgell
57f2f1d72a waf: remove the restriction that private libraries must not have a vnum
we need the vnum for ABI checking for public libraries built as
private libraries when bundled

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Dec  9 12:47:41 CET 2010 on sn-devel-104
2010-12-09 12:47:40 +01:00
Andrew Tridgell
ebe2867fc2 waf-abi: auto-generate per-symbol versions from ABI files
This changes our version-script generation to use the ABI files that
are saved in git with each version number change of our public
libraries.

We use these ABI files to generate a linker version script that gives
the exact version number that each symbol was introduced. This
provides us with automatic fine grained symbol versioning.

Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-12-09 13:17:19 +11:00
Andrew Tridgell
735c1cd2da s4-pkgconfig: add @LIB_RPATH@ to our link flags
this is only set when rpath is used on install. It ensures that
applications that link against Samba libraries get the rpath right

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Dec  8 12:46:00 CET 2010 on sn-devel-104
2010-12-08 12:46:00 +01:00
Kai Blin
3f43b7e542 tevent: Fix docstring, tevent_req_is_in_progress does not destroy private data
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Wed Nov 17 07:23:51 UTC 2010 on sn-devel-104
2010-11-17 07:23:51 +00:00
Matthias Dieter Wallnöfer
bb241f5cf8 s4:pytevent.c - fix a discard const warning
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Nov 11 09:47:55 UTC 2010 on sn-devel-104
2010-11-11 09:47:54 +00:00
Andrew Tridgell
14718a725b build: a more portable way of finding waf in makefiles
this avoids using the non-portable shell command in makefiles

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Nov  3 22:44:59 UTC 2010 on sn-devel-104
2010-11-03 22:44:59 +00:00
Andrew Tridgell
f0a472a2d6 waf: added reconfigure targets to our libraries
This allows you to do "make reconfigure" to re-run configure only if
needed
2010-11-03 01:34:04 +00:00
Jelmer Vernooij
fe6d404ea5 tevent: Drop autoconf-based build system for standalone build. 2010-10-30 17:50:09 +02:00
Jelmer Vernooij
50256c01d0 waf: Only specify vnum for non-private libraries. 2010-10-26 10:17:18 -07:00
Jelmer Vernooij
49ef288819 waf: Rename some BUNDLED_ functios to PRIVATE_. 2010-10-23 22:24:06 +00:00
Andrew Tridgell
7cba3cfac8 waf: replace the is_bundled option with private_library
'private_library' better captures what we are trying to get at when we
bundle a library
2010-10-21 19:03:24 +11:00
Andrew Tridgell
713900b812 s4-build: fixed some formatting
indentation was far too deep
2010-10-21 19:03:24 +11:00
Volker Lendecke
e36e67fe04 tevent: Do not use talloc_autofree_context 2010-10-08 21:11:45 +02:00
Volker Lendecke
1c9b856670 tevent: Only call handlers that ask for events
The s3 libsmbclient puts two different handlers on a single fd for readability
and writability. With select this works fine, however without this patch we
unconditionally call the write handler even if the socket is only readable. We
should have called the read handler instead.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Oct  6 23:40:24 UTC 2010 on sn-devel-104
2010-10-06 23:40:24 +00:00
Jelmer Vernooij
63928c82c1 ldb/tevent: Fix detection of waf paths. 2010-09-28 09:12:41 +02:00
Jelmer Vernooij
4752d88fed tevent: Remove make targets that are not relevant for tevent. 2010-09-28 09:12:41 +02:00
Jelmer Vernooij
302423f306 tevent: Don't update Makefile/configure files. 2010-09-28 09:12:40 +02:00
Jelmer Vernooij
0a18f89e8a pyteven: Fix build warnings. 2010-09-25 12:20:58 -07:00
Jelmer Vernooij
296ff486e4 Check in configure/Makefile for those projects that have waf as primary build system. 2010-09-25 12:20:57 -07:00
Jelmer Vernooij
e68afdc02f pytevent: Add more tests. 2010-09-25 12:20:57 -07:00
Jelmer Vernooij
ddb3c48f1a pytevent: Fill in client side fnuctions. 2010-09-25 12:20:57 -07:00
Jelmer Vernooij
465cff7531 tevent: Add infrastructure for python bindings. 2010-09-25 12:20:56 -07:00
Jelmer Vernooij
1f22b63b34 tevent: Switch to using waf by default. 2010-09-25 12:20:56 -07:00
Jelmer Vernooij
bd1786f7f1 wafsamba: Fix typo: noextenion -> noextension. 2010-06-19 12:10:29 +02:00
Volker Lendecke
7f29f817fa tevent: Fix maxfd calculation in tevent_select
When doing

        fd1 = tevent_add_fd(ev, ev, 2, 0, NULL, NULL);
        fd2 = tevent_add_fd(ev, ev, 3, 0, NULL, NULL);
        TALLOC_FREE(fd2);
        fd2 = tevent_add_fd(ev, ev, 1, 0, NULL, NULL);

we end up with select_ev->maxfd==1. This is wrong.

An alternative fix might be to make select_ev->maxfd an unsigned int and make
EVENT_INVALID_MAXFD==UINT_MAX. But in theory we might end up with an fd of
UINT_MAX.

std_event_add_fd() contains exactly the same piece of code, so I'm directly
pushing it.

Volker
2010-06-10 11:24:00 +02:00
Jelmer Vernooij
3858b5db8b s4-waf: sanitize library names like the old build system did, only add
-samba4 suffix for libraries that are bundled.
2010-05-31 03:28:42 +02:00
Andreas Schneider
3addebee34 tevent: Added a description for tevent queue. 2010-05-10 10:28:37 +02:00
Andreas Schneider
d596bb1a1d tevent: Added an introduction to the tevent_queue tutorial.
Thanks Volker.
2010-05-10 10:28:37 +02:00
Andreas Schneider
b2e520a28b tevent: Fixed a doxygen problem with PRINTF_ATTRIBUTE. 2010-05-10 10:28:37 +02:00
Andreas Schneider
dc2f962aac tevent: Started a tevent_queue tutorial. 2010-05-05 09:28:04 +02:00
Andreas Schneider
239d59feab tevent: Document the tevent_queue functions. 2010-05-05 09:28:04 +02:00
Andreas Schneider
6c1bcdc2e2 tevent: Document the tevent helper functions. 2010-05-05 09:28:04 +02:00
Andreas Schneider
78fbedf369 tevent: Document missing callback typedefs. 2010-05-05 09:28:04 +02:00
Andreas Schneider
a8e575ac22 tevent: Document the missing tevent async request callback functions. 2010-05-05 09:28:04 +02:00
Andreas Schneider
d8a6b23b07 tevent: Create a typedef for the debug function callback. 2010-05-05 09:28:04 +02:00
Stephen Gallagher
e286966bba tevent: Added more documentation. 2010-05-05 09:28:04 +02:00
Stephen Gallagher
098221e886 tevent: Remove erroneous comments about TEVENT_FD_AUTOCLOSE
There is no such flag.
2010-05-05 09:28:04 +02:00
Andreas Schneider
49c89b60e6 tevent: Add doxygen tevent config file. 2010-05-05 09:28:04 +02:00
Andreas Schneider
4263983cad tevent: Added basic doxygen documentation. 2010-05-05 09:28:04 +02:00
Andrew Tridgell
7aa4c11fc4 build: more adjustments for the ABI type name maps
- use 'va_list' instead of 'struct __va_list_tag *'
  Using the C name for va_list is preferable

- add support for negative ABI name matches in abi_match=.  That is
  used to exlude ldb_*module_ops from the ldb ABI

- don't include the ldb module ops or backend ops in the ABI
2010-04-18 18:24:27 +10:00
Andrew Tridgell
f96353adcf s4-waf: rebuild signature files with the api type maps
This is not strictly necessary, as the old types would compare equal,
but it is neater to use the generic type names
2010-04-18 15:39:59 +10:00
Andrew Tridgell
5e26f65f79 tevent-waf: enabled ABI checking in tevent 2010-04-18 15:00:38 +10:00
Andrew Tridgell
2550bbc981 tevent: mark backend init fns as _PRIVATE_
these are not supposed to be exposed in the library
2010-04-18 15:00:38 +10:00
Andrew Tridgell
483d059c8e tevent-waf: added man page and pkgconfig file
this allows libtevent to build under rpmbuild

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-13 23:03:27 +10:00
Andrew Tridgell
ab73692bd3 s4-tevent: up tevent version number
tevent now has tevent_re_initialise() which is needed for the s4 build
2010-04-13 11:45:38 +10:00
Andrew Tridgell
98942c8d84 build: use a common autogen-waf.sh for all builds
the symlink will get updated with the right target when waf dist is
used in each directory
2010-04-12 11:17:35 +10:00
Andrew Tridgell
7ae4372124 s4-waf: fixed waf distcheck for our standalone libs and s4 2010-04-06 20:27:26 +10:00
Andrew Tridgell
fe060c8f50 s4-waf: added simple 'waf test' support for tdb, talloc and ldb 2010-04-06 20:27:26 +10:00
Andrew Tridgell
ccfce0bbae s4-waf: autogen-waf.sh for the standalone library builds 2010-04-06 20:27:25 +10:00
Andrew Tridgell
c8835f440a s4-waf: use a common pattern for finding buildtools and libs 2010-04-06 20:27:25 +10:00
Andrew Tridgell
553324bc10 s4-waf: move to a universal method of recursing into subdirs
This works with both standalone lib builds and bundled builds
2010-04-06 20:27:25 +10:00
Andrew Tridgell
8dc8d31f4a s4-waf: fixed finding of buildtools and srcdir 2010-04-06 20:27:25 +10:00
Andrew Tridgell
1883ee6dbc s4-waf: avoid having to run waf configure before waf dist
This should be useful for building tarballs from a clean checkout
2010-04-06 20:27:25 +10:00
Andrew Tridgell
9e9e878e8f s4-waf: allow standalone tarball build of libraries 2010-04-06 20:27:25 +10:00
Andrew Tridgell
528d7c7cf3 s4-waf: added 'waf dist' to our standalone libs as well 2010-04-06 20:27:25 +10:00
Andrew Tridgell
874e39cbf0 s4-waf: added implied_deps for system libraries
when we use a system version of a library such as talloc, then we
no longer get the automtica dependency propogation of talloc implying
libreplace. That means we don't get the includes for libreplace, which
means things can fail to build.

To fix this this change adds an implied_deps option to
CHECK_BUNDLED_SYSTEM(), which tells the samba_deps module to add an
implied dependency on the listed targets if the system library is
chosen.
2010-04-06 20:27:17 +10:00
Andrew Tridgell
a2b4d7e8eb s4-waf: ensure we don't end up with mixed versions of talloc/tdb/tevent 2010-04-06 20:27:15 +10:00
Andrew Tridgell
bfbf43cc36 s4-waf: support the use of system libraries
distros can set --bundled-libraries=NONE to force use of all system
libraries. If the right version isn't found then configure will fail.

Users may choose which libraries to use from the system, and which to
use bundled libs. The default is to try system libs, and use them if
their version matches the one in the source tree.
2010-04-06 20:27:13 +10:00
Andrew Tridgell
c2d17cf978 s4-waf: set default for bundled libraries 2010-04-06 20:27:12 +10:00
Andrew Tridgell
42c9380760 s4-waf: set the bundled library extension for some libs 2010-04-06 20:27:12 +10:00
Andrew Tridgell
f9eae32f4b s4-waf: mark the wscript files as python so vim/emacs knows how to highlight them 2010-04-06 20:27:11 +10:00
Andrew Tridgell
00649a9c62 build: updated configure checks or new syntax 2010-04-06 20:27:00 +10:00
Andrew Tridgell
6858e73e40 build: tevent_epoll.c is conditional on HAVE_EPOLL 2010-04-06 20:26:58 +10:00
Andrew Tridgell
5ad6369cd0 build: started to split up wafsamba.py into separate modules 2010-04-06 20:26:38 +10:00
Andrew Tridgell
a3421fe6e9 build: added BUILD_SUBDIR() wrapper 2010-04-06 20:26:35 +10:00
Andrew Tridgell
9a1cd09a10 build: added ADD_CFLAGS() and started of Samba4 build 2010-04-06 20:26:34 +10:00
Andrew Tridgell
2b5a1cc70c build: added waf build rules for ldb 2010-04-06 20:26:34 +10:00
Andrew Tridgell
8f062f4a0f build: neater way to find libreplace and start on tevent waf build 2010-04-06 20:26:33 +10:00
Andrew Tridgell
5609c50433 tevent: added tevent_re_initialise()
This allows us to re-initialise a tevent context without destroying
the pointer. That means that if someone keeps a long term ptr to the
event context across a fork it will still work.

This also brings the memory handling in single and standard process
models much closer together, which means less bugs that we don't find
with make test.
2010-03-26 21:13:27 +11:00
Brad Hards
119a8230eb Spelling fixes for tevent.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:32 +01:00
Andrew Tridgell
ccfa40fdc3 util: update three other copies of our dlinklist.h macros
ldb and tevent have their own copies of these macros. This brings them
in sync with the master copy of dlinklist.h
2010-02-14 18:44:21 +11:00
Bo Yang
8c8bb51de1 s3: signals are processed twice in child.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-02-09 17:05:58 +08:00
Brian Lu
f408d58d95 tevent: create symbol links to shared libraries see https://bugzilla.samba.org/show_bug.cgi?id=6991 for details
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-06 14:27:38 +01:00
Stefan Metzmacher
4b7a6b1f8f tevent: prefix types and defined with tevent_ and TEVENT_
This fixes the build warnings on some build-farm hosts.

metze
2009-12-20 14:21:50 +01:00
Volker Lendecke
4d8118f145 tevent: Fix a comment 2009-11-26 17:22:56 +01:00
Jeremy Allison
295fec2b46 NULL is not a valid event context.
Jeremy.
2009-10-01 16:18:33 -07:00
Simo Sorce
76d836570e Fixing timeval calculation
The code was always doubling microseconds when attempting to round up.
2009-09-25 11:00:19 -04:00
Rusty Russell
455d44d961 lib/tevent: a cleaner fix for be4ac22784 segv
Revert 23abcd2318 and fix logic bug.

The current code loops through the event contexts, when it sees a different
one, it notifies the current one (ev) and updates ev to point to the new one.

This is dumb, because:
(1) ev starts as NULL, so this code crashes, and
(2) The final context will not be notified.

The correct fix for this is to update ev to the new one, then notify it.
Volker's fix works because we currently always have one event context.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-09-22 10:50:28 +02:00
Stefan Metzmacher
d13dfbeb6c tevent: make sure we don't set errno within the signal handler function.
metze
2009-09-21 05:54:41 +02:00
Michael Adam
64bfa26f99 tevent:mksyms: fix spelling...
Michael
2009-09-11 15:39:52 +02:00
Michael Adam
6b9298191a tevent:signatures: add _tevent_req_cancel and tevent_req_set_cancel_fn
introduced in 45e4be0d96

Michael
2009-09-11 15:31:29 +02:00
Michael Adam
7165f29aea tevent:exports: add _tevent_req_cancel and tevent_req_set_cancel_fn.
These were added in 45e4be0d96

Michael
2009-09-11 15:31:28 +02:00
Michael Adam
f98470e3a4 tevent:mksigs: allow PRINTF_ATTRIBUTE(..) macros function types as funcion args
Michael
2009-09-11 15:31:28 +02:00
Michael Adam
085c07b743 tevent:mksigs: normalize bool -> _Bool
Michael
2009-09-11 15:31:28 +02:00
Michael Adam
636f8b5e5b tevent:mksigs: ignore symbols (like _DEPRECATED_) after closing function parentheses
Michael
2009-09-11 15:31:27 +02:00
Michael Adam
aa7748484f tevent:mksigs: correctly ignode multiline function typedefs
by first concatenating multilint parentheses and removing typefes afterwards.

Michael
2009-09-11 15:31:27 +02:00
Michael Adam
1e2393c178 tevent:mksigs: ignore struct forward declarations.
Michael
2009-09-11 15:31:27 +02:00
Michael Adam
1f1a900dd7 tevent:mksyms: allow characters after closing functions parenthesis.
Michael
2009-09-11 15:31:26 +02:00
Michael Adam
095a11226e tevent:mksyms: allow double pointer return value of functions.
Michael
2009-09-11 15:31:26 +02:00
Michael Adam
4fb82727b1 tevent: add abi_checks to "make test"
Michael
2009-09-11 15:31:25 +02:00
Michael Adam
cf67b1bff7 tevent: remove filese generated by "make abi_checks" in "make clean".
Michael
2009-09-11 15:31:24 +02:00
Michael Adam
40c670f8cb tevent: add a make target "make abi_checks"
Michael
2009-09-11 15:31:24 +02:00
Michael Adam
f0e276cff8 tevent: move the original abi_checks script to script/abi_checks_gcc.sh
Michael
2009-09-11 15:31:24 +02:00
Michael Adam
31ee072934 tevent: add script/abi_checks.sh. check for abi changes without gcc magic.
USAGE: abi_checks.sh LIBRARY_NAME header1 [header2 ...]

This creates symbol signature lists using the mksyms and mksigs scripts
and compares them with the checked in lists.

Michael
2009-09-11 15:31:23 +02:00
Michael Adam
ffc72b9207 tevent: add script to extract signatures from header files.
This produces output like the output gcc produces when
invoked with the -aux-info switch.

Run like this: cat include/tevent.h | ./script/mksigs.pl

This simple parser is probably too coarse to handle all
possible header files, but it treats tevent.h correctly...

Michael
2009-09-11 15:31:23 +02:00
Michael Adam
4530fcd820 tevent: add scripts to extract library symbols (exports file) from headers
Michael
2009-09-11 15:31:23 +02:00
Simo Sorce
ab6e82910a Add release script for tevent 2009-09-04 18:20:29 -04:00
Stefan Metzmacher
1bb68402a2 tevent: change version to 0.9.8 after some critical bugs have been fixed
metze
2009-09-04 13:01:06 +02:00
Jeremy Allison
c97698e762 Another part of the fix for bug 6651 - smbd SIGSEGV when breaking oplocks.
SA_INFO_QUEUE_COUNT *MUST* be a power of 2, in order for the ring buffer
wrap to work correctly at the 32 bit boundary. Thanks to Petr
Vandrovec <petr@vandrovec.name> for this.
2009-09-03 07:38:21 -07:00
Volker Lendecke
23abcd2318 tevent: Fix a segfault upon the first signal
When the first signal arrives, tevent_common_signal_handler() crashed: "ev" is
initialized to NULL, so the first "write(ev->pipe_fds[1], &c, 1);" dereferences
NULL.

Rusty, Tridge, please check. Also, can you tell me a bit more about the
environment you tested this in? I'd be curious to see where this survived.

Thanks,

Volker
2009-08-29 09:49:08 +02:00
Rusty Russell
76d91156c8 lib/tevent: close pipe_fds on event_context destruction
The "hack_fds" were never closed before; now they're inside event_context
they should be closed when that is destroyed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-08-28 14:10:22 +10:00
Rusty Russell
be4ac22784 lib/tevent: handle tevent_common_add_signal on different event contexts.
I don't know if this is a problem in real life.

The code assumes there's only one tevent_context; all signals will notify
the first event context.  That's counter-intuitive if you ever use more
than one, and there's nothing else in this code which prevents it AFAICT.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-08-28 14:09:09 +10:00
Rusty Russell
6abb637e3e lib/tevent: fix race with signals and tevent_common_add_signal
We carefully preserve the old signal handler, but we replace it before
we've set up everything; in particular, if we fail setting up the
pipe_hack we could write a NUL char to stdout (fd 0), instead of
calling the old signal handler.

Replace the signal handler as the very last thing we do.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-08-28 14:03:41 +10:00
Rusty Russell
4279879c98 lib/tevent: remove spectacularly complicated manual subtraction
To be completely honest, I don't quite know whether to laugh or cry at
this one:

	1 + (0xFFFFFFFF & ~(s.seen - s.count))
	== 1 + (~(s.seen - s.count))		# s.seen, s.count are uint32_t
	== s.count - s.seen			# -A == ~A + 1

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-08-28 13:08:01 +10:00
Günther Deschner
965a079535 tevent: avoid using reserved c++ word.
Guenther
2009-08-24 14:31:02 +02:00
Jeremy Allison
ba52f18bfe Fix for bug 6651 - smbd SIGSEGV when breaking oplocks.
Based on a patch submitted by Petr Vandrovec <petr@vandrovec.name>.
Multiple pending signals with siginfo_t's weren't being handled correctly
leading to smbd abort with kernel oplock signals.
Jeremy
2009-08-21 15:07:25 -07:00
Michael Adam
5270efab1a tevent: fix a comment
Michael
2009-08-19 11:39:44 +02:00
Stefan Metzmacher
97a1ed53ca tevent: change version to 0.9.7 after adding tevent_req_cancel infrastructure
metze
2009-08-17 09:25:44 +02:00
Stefan Metzmacher
45e4be0d96 tevent: add tevent_req_cancel() infrastructure
This offers a generic way for callers to cancel an
async request.

metze
2009-08-17 09:25:44 +02:00
Stefan Metzmacher
95c3d3b5d8 tevent: add some more doxygen comments for tevent_req functions
metze
2009-08-15 10:46:36 +02:00
Stefan Metzmacher
39684d2cbe tevent: try to fix the build on QNX qnx18 6.4.1 it doesn't have SA_RESTART defined
metze
2009-07-16 11:41:28 +02:00
Jeremy Allison
5927ca7067 Change to talloc_zero_size instead of extra memset.
Jeremy.
2009-07-14 16:54:01 -07:00
Jeremy Allison
7be1d727a3 When tallocing a memory block for the state in a tevent_req struct,
ensure it's zeroed out. Vl & Metze please check.
Jeremy.
2009-07-14 16:42:21 -07:00
Simo Sorce
7119241c0d Sort the signature files 2009-07-03 08:45:30 -04:00
Simo Sorce
30b2014a01 Expose functions need by backend writers
move publicly needed structures and functions in the public header.
Stop installing internal headers.
Update the signature and exports files with the new exposed
function.
2009-07-03 08:45:30 -04:00
Simo Sorce
c92505817d Revert "For tevent to install tevent_util.h"
This reverts commit b112cc5503.

tevent_util.h is a private header. Must not be installed.
2009-06-18 07:56:51 -04:00
Eric Sandall
b112cc5503 For tevent to install tevent_util.h
Patch for bug #6270

This patch is for the future when samba4 builds using external libraries. With
this patch, tevent now installs tevent_util.h which is required by samba4.
2009-06-18 13:49:26 +10:00
Simo Sorce
efccef09ae Add exports file and abi checker for tevent
This is a first attempt at exporting symbols only for public functions
We also provide a rudimentary ABI checker that tries to check that
function signatures are not changed by mistake.
Given our use of macros this is not an API checker.
It's all based on tevent.h contents and the gcc -aux-info option
2009-06-15 16:31:13 -04:00
Volker Lendecke
d0aedeb46e Increase tevent version for tevent_req_notify_callback() 2009-06-04 17:50:44 +02:00
Volker Lendecke
c6f39b46a7 Add tevent_req_notify_callback
This is necessary for requests that have multiple results. Examples would be
SMBEcho and ldap_search.
2009-06-04 17:29:48 +02:00
Jelmer Vernooij
cf9636ea99 tevent/python: Makefile was still trying to build some non AC_SUBST python targets
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
2009-05-19 23:33:00 +02:00
Jelmer Vernooij
72b744f38e tevent: Define TALLOC_FREE() if it's not defined yet, to allow building
with released versions of talloc.
2009-05-16 20:31:59 +02:00
Jelmer Vernooij
5065cf70f8 tevent: Remove python module.
This module didn't have any functionality that we actually used yet, and
it was quite small.

Tevent is quite low level and perhaps doesn't make much sense to expose
directly as a Python module. It was also causing build problems when used with a
system-tevent. We can always back later if necessary.
2009-05-16 14:56:37 +02:00
Jelmer Vernooij
857c3f8322 tevent: Install tevent_internal.h in the standalone build.
This is not ideal, but at least it fixes the build of samba-gtk for now.
I've also added a warning about API guarantees at the top of the header.
2009-05-16 04:14:21 +02:00
Jelmer Vernooij
6230eb94af Update copies of config.guess and config.sub. 2009-05-16 04:03:12 +02:00
Jelmer Vernooij
06864b4469 tevent: Don't install headers, since we don't install a shared lib
either (from Samba).
2009-05-16 01:54:10 +02:00
Stefan Metzmacher
6f7cd213dd tevent: fix typo async_req_done() => tevent_req_done()
metze
2009-05-07 08:09:56 +02:00
Stefan Metzmacher
36e7045340 tevent: fix the nesting logic
Only tevent_loop_once and tevent_loop_until() should care
about the nesting level.

This fixes the samba3 printing code where we use tevent_loop_wait()
and don't allow nested events.

We still call the nesting hook for all levels, we need to decide
if we really want this...

metze
2009-03-19 14:39:22 +01:00
Andrew Tridgell
13b6663e23 fixed a logic bug in the tevent nesting code
The event nesting code never triggered as nesting.level was never
greater than 1. The main event loop needs to increase the nesting
level by 1.

I also added a paranoia check to the nesting setup call. The API as
currently written cannot support multiple nesting hooks, so we need to
abort if multiple hooks are tried.
2009-03-19 11:21:36 +11:00
Stefan Metzmacher
7d07266ca2 tevent: change version to 0.9.5 after the ABI has changed
metze
2009-03-17 20:19:11 +01:00
Stefan Metzmacher
9eaf53d98e tevent: store the location where a request was finished
This is very useful to find bugs.
You can use 'p *req' in gdb to show where
tevent_req_done(), tevent_req_error() or tevent_req_nomem()
was called.

metze
2009-03-17 20:17:01 +01:00
Stefan Metzmacher
3a831e4620 tevent: use an immediate event as trigger for tevent_queue
metze
2009-03-17 19:59:09 +01:00
Stefan Metzmacher
4bdf299385 tevent: use an immediate event fot tevent_req_post()
Now tevent_req_post() never fails

metze
2009-03-17 19:59:08 +01:00
Stefan Metzmacher
a78cd2a24b tevent: use TALLOC_FREE() in tevent_req.c
metze
2009-03-17 19:59:08 +01:00
Stefan Metzmacher
66886f8966 tevent: add support for immediate events
They're like directly triggered timed events,
but you can preallocated them and scheduling them
will not fail.

metze
2009-03-17 19:59:00 +01:00
Stefan Metzmacher
940e61846e tevent: add tevent_common_loop_wait() helper function and use it
tevent_loop_wait should do the same for all backends.
It should loop as long as we have pending events.

metze
2009-03-17 19:58:57 +01:00
Stefan Metzmacher
0139befb91 tevent: check signal events first in event_loop_once
We also check for signal events directly before and after
the select/epoll calls.

metze
2009-03-17 19:58:56 +01:00
Stefan Metzmacher
3af7db3dce tevent: let tevent_loop_once() just run one fd event
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-17 19:58:55 +01:00
Stefan Metzmacher
868f3f5f32 tevent: change version to 0.9.4 as the ABI has changed
metze
2009-03-13 15:49:35 +01:00
Tim Prouty
a84f939f4f tevent: Fix might be unitialized warning 2009-03-12 12:28:13 -07:00
Stefan Metzmacher
cb388882cf tevent: add tevent_loop_until()
This is only a hack for samba4 and should not be used
in new code.

metze
2009-03-12 14:21:26 +01:00
Stefan Metzmacher
7142ef49bd tevent: add tevent_loop_set_nesting_hook()
This is an ugly hack to let the s4 server work arround
some bugs related to nested events and uid changing.

metze
2009-03-12 14:21:26 +01:00
Stefan Metzmacher
06f88fe7a2 tevent: don't allow nested tevent_loop_once() anymore
Incompatible caller should use tevent_loop_allow_nesting()
function.

metze
2009-03-12 12:14:18 +01:00
Stefan Metzmacher
9932fd2d9a tevent: pass __location__ to tevent_loop_once/wait()
metze
2009-03-12 12:12:34 +01:00
Stefan Metzmacher
880d9d6d8c tevent: add tevent_set_abort_fn()
metze
2009-03-12 12:04:33 +01:00
Stefan Metzmacher
43a7d48d24 tevent: add tevent_signal_support()
Not every tevent backend supports signal events.

metze
2009-03-12 12:04:31 +01:00
Stefan Metzmacher
825949b810 tevent: add tevent_req_callback_data_void() macro
Callers can use it instead of tevent_req_callback_data()
if they use a non talloc private pointer.

metze
2009-03-10 16:44:44 +01:00
Stefan Metzmacher
09d1b2324c tevent: add tevent_req_received() function
This function can be called as last action of a _recv()
function, it destroys the data attached to the tevent_req.

metze
2009-03-10 16:44:44 +01:00
Simo Sorce
67d41d0fc7 Make struct tevent_req opaque
Move struct tevent_req in tevent_internal, and ad getters and setters
for private data and the callback function.
This patch also renames 'private_state' into 'data'. What is held in this
pointer is in fact data and not a state like enum tevent_req_state.
Calling it 'state' is confusing.

The functions addedd are:
tevent_req_set_callback() - sets req->async.fn and req->async.private_data
tevent_req_set_print_fn() - sets req->private_print
tevent_req_callback_data() - gets req->async.private_data
tevent_req_data() - gets rea->data

This way it is much simpler to keep API/ABI compatibility in the future.
2009-03-02 11:02:09 -05:00
Jelmer Vernooij
09ac816b36 Merge branch 'master' of git://git.samba.org/samba into teventfix
Conflicts:
	lib/tevent/pytevent.c
2009-03-01 16:39:35 +01:00