1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-28 03:33:13 +03:00
Commit Graph

106 Commits

Author SHA1 Message Date
Stefan Metzmacher
4b07123686 events_signal: pass down the correct siginfo_t struct to the event handler
metze
2008-03-11 20:16:51 +01:00
Jelmer Vernooij
6c659689ed Move public header accumulation out of the perl code.
Never install generated prototype files. It's easier to break the
API when using them and they're not easily readable for 3rd party users.

Conflicts:

	source/auth/config.mk
	source/auth/credentials/config.mk
	source/auth/gensec/config.mk
	source/build/smb_build/config_mk.pm
	source/build/smb_build/main.pl
	source/build/smb_build/makefile.pm
	source/dsdb/config.mk
	source/lib/charset/config.mk
	source/lib/tdr/config.mk
	source/lib/util/config.mk
	source/libcli/config.mk
	source/libcli/ldap/config.mk
	source/librpc/config.mk
	source/param/config.mk
	source/rpc_server/config.mk
	source/torture/config.mk
2008-02-29 14:23:38 +01:00
Jelmer Vernooij
da1a9438bd Make more module init functions public, since they are compiled with -fvisibility=hidden. Not doing this causes failures on Mac OS X. 2008-02-20 19:40:20 +01:00
Jelmer Vernooij
50c46160d9 r26669: Janitorial: Remove uses of global_loadparm. 2008-01-05 09:42:02 -06:00
Jelmer Vernooij
7873666a95 r26625: Wrap some more events functions for Python and add a trivial test for it. 2007-12-28 11:03:01 -06:00
Jelmer Vernooij
73c0b1c897 r26620: python: Allow not specifying event contexts, in which case a new context is used. 2007-12-28 10:33:01 -06:00
Kai Blin
e59c2eaf68 r26588: Janitorial: Rename torture_*_add_*test to torture_*_add_*test_const.
Also rename the corresponding wrap_ functions.
2007-12-26 11:57:05 -06:00
Jelmer Vernooij
f1997dabed r26580: Include sentinel in build.h, in case the list is empty. 2007-12-24 01:51:07 -06:00
Jelmer Vernooij
ba8be2dfc0 r26576: Allow the static module loading code to be used for the Python modules.
Simplify the way module initialization functions are handled.
2007-12-24 01:51:06 -06:00
Jelmer Vernooij
c550c03372 r26570: - Trim size of the swig-generated Python bindings by removing a bunch of {}'s.
- Start working on Python equivalents for various EJS tests.
- Fix regression in argument order for reg_diff_apply() in EJS bindings.
2007-12-24 01:51:03 -06:00
Jelmer Vernooij
2b7cfa5d9a r26464: Tighten dependencies. 2007-12-21 05:50:29 +01:00
Jelmer Vernooij
3378b6a559 r26399: Use -O option for SWIG (less evil generated code). 2007-12-21 05:49:29 +01:00
Stefan Metzmacher
60b852688c r26288: events: events.h uses uint16_t so it needs stdint.h
stdlib.h isn't used directly and talloc.h brings it in anyway

this fixes the build of lib/events/./events_wrap.c
on older systems linux versions.

metze
2007-12-21 05:48:10 +01:00
Jelmer Vernooij
99113075c4 r26266: Remove more global_loadparm uses. 2007-12-21 05:47:42 +01:00
Jelmer Vernooij
08501fbef3 r26248: Check in SWIG output so SWIG is not required when running out of svn. 2007-12-21 05:47:26 +01:00
Jelmer Vernooij
f7312cbb76 r26195: Wrap two more functions. 2007-12-21 05:46:46 +01:00
Jelmer Vernooij
cfb6bbdc31 r26194: Wrap the events subsystem in a separate file. 2007-12-21 05:46:45 +01:00
Jelmer Vernooij
f734df3144 r25903: Move more files out of torture/ 2007-12-21 05:44:46 +01:00
Andrew Tridgell
67240f380b r25676: fixed a valgrind error in the epoll event backend. The linked list
could get mucked up.
2007-12-21 05:43:09 +01:00
Jelmer Vernooij
f9270073a2 r25537: Use new path for events modules. 2007-10-10 15:07:49 -05:00
Jelmer Vernooij
5e814287ba r25522: Convert to standard bool types. 2007-10-10 15:07:47 -05:00
Jelmer Vernooij
3468952e77 r25446: Merge some changes I made on the way home from SFO:
2007-09-29 More higher-level passing around of lp_ctx.
2007-09-29 Fix warning.
2007-09-29 Pass loadparm contexts on a higher level.
2007-09-29 Avoid using global loadparm context.
2007-10-10 15:07:34 -05:00
Jelmer Vernooij
fd697d77c9 r25430: Add the loadparm context to all parametric options. 2007-10-10 15:07:31 -05:00
Jelmer Vernooij
df9cebcb97 r25035: Fix some more warnings, use service pointer rather than service number in more places. 2007-10-10 15:05:43 -05:00
Jelmer Vernooij
5085c53fcf r25027: Fix more warnings. 2007-10-10 15:05:41 -05:00
Jelmer Vernooij
abe8349f9b r25026: Move param/param.h out of includes.h 2007-10-10 15:05:38 -05:00
Jelmer Vernooij
9647f860bd r24814: Fix headers, trim core.h even more. 2007-10-10 15:03:14 -05:00
Andrew Bartlett
fb1e1eebda r24502: More work to get LOCAL-EVENT passing on all platforms:
- Make the epoll_event_context_init() call fail if epoll_create() fails.

  This should cause this backend to be skipped on host with epoll() in
  libc but not in the kernel.

- At the moment, there is no sensible way to handle failures to add an
  epoll() event, and 'fallback to select' is misnamed (so we now
  abort()).

Andrew Bartlett
2007-10-10 15:02:02 -05:00
Andrew Tridgell
fcf38a38ac r23792: convert Samba4 to GPLv3
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
2007-10-10 14:59:12 -05:00
Andrew Tridgell
76b981fcef r23301: merged from ctdb 2007-10-10 14:53:10 -05:00
Andrew Tridgell
d28fc5f87f r22985: don't do checkins late at night ....
thanks to Volker for spotting this!
2007-10-10 14:52:35 -05:00
Andrew Tridgell
146303d91b r22971: fix build on systems without epoll 2007-10-10 14:52:34 -05:00
Andrew Tridgell
603d8b6f17 r22970: the events code calls close(), which needs to use socket_wrapper.h in
the build farm
2007-10-10 14:52:34 -05:00
Andrew Tridgell
4f84e6d569 r22968: andrew bartlett pointed out that the parent process could add a fd to
the epoll context which would then appear in the children. To fix this
we need to check for pid changes in more places. Luckily on platforms
where we have epoll(), getpid() is very very cheap.
2007-10-10 14:52:33 -05:00
Andrew Tridgell
a69f285998 r22964: log an error on epoll_create failing on reopen 2007-10-10 14:52:32 -05:00
Andrew Tridgell
aeca07659a r22963: fixed the epoll/fork interaction in the epoll and aio backends 2007-10-10 14:52:32 -05:00
Andrew Tridgell
6d06132ea9 r22959: cope with a rather interesting interaction between epoll() and
fork(). See
http://junkcode.samba.org/ftp/unpacked/junkcode/epoll_fork.c for why
this is needed
2007-10-10 14:52:31 -05:00
Andrew Tridgell
f1ad216de1 r22830: merged the latest lib/events updates from ctdb to Samba4. This
includes a new EVENT_FD_AUTOCLOSE flag that prevents race conditions
where code using fd events might close a fd before releasing the
struct fd_event. That causes headaches for epoll.
2007-10-10 14:52:21 -05:00
Stefan Metzmacher
4db64b4ce2 r22661: optimize the handling of directly triggered timed events:
- if someone adds a timed_event with a zero timeval
  we now avoid serval gettimeofday() calls and the
  event handler doesn't get the current time when it's
  called, instead we also pass a zero timeval

- this also makes sure multiple timed events with a zero timeval
  are processed in the order there're added.

the little benchmark shows that processing 2000000 directly timed events
is now much faster, while avoiding syscalls at all!

> time ./evtest (with the old code)

real    0m6.388s
user    0m1.740s
sys     0m4.632s
> time ./evtest (with the new code)

real    0m1.498s
user    0m1.496s
sys     0m0.004s
metze@SERNOX:~/devel/samba/4.0/samba4-ci/source> cat evtest.c
#include <stdio.h>
#include <stdint.h>
#include <sys/time.h>
#include <talloc.h>
#include <events.h>

static void dummy_fde_handler(struct event_context *ev_ctx, struct fd_event *fde,
                              uint16_t flags, void *private_data)
{
}

static void timeout_handler(struct event_context *ev, struct timed_event *te,
                            struct timeval tval, void *private_data)
{
        uint32_t *countp = (uint32_t *)private_data;
        (*countp)++;
        if (*countp > 2000000) exit(0);
        event_add_timed(ev, ev, tval, timeout_handler, countp);
}

int main(void)
{
        struct event_context *ev;
        struct timeval tval =  { 0, 0 };
        uint32_t count = 0;
        ev = event_context_init(NULL);
        event_add_fd(ev, ev, 0, 0, dummy_fde_handler, NULL);
        event_add_timed(ev, ev, tval, timeout_handler, &count);
        return event_loop_wait(ev);
}
2007-10-10 14:51:58 -05:00
Andrew Tridgell
b0c8c1cd21 r22634: make the events system much less dependent on the samba4 build system 2007-10-10 14:51:56 -05:00
Andrew Tridgell
216aa06fe6 r22632: merged volkers select events fix 2007-10-10 14:51:56 -05:00
Jelmer Vernooij
e782035251 r21299: Fix the build for those that don't have talloc.h installed. 2007-10-10 14:48:05 -05:00
Jelmer Vernooij
07652f65ce r21297: Remove the GTK+ tools and library from the main repository. They are now maintained separately in bzr at http://people.samba.org/bzr/jelmer/samba-gtk
This also adds some more headers to the list that is installed and a couple of extra #include lines so these
headers can be used externally without problems.
2007-10-10 14:48:04 -05:00
Andrew Tridgell
2ff8abf002 r21212: detect if the kernel does not support integrated epoll/aio when the
event context is created. This allows the LOCAL-EVENT test to pass on
systems with have libaio but not the necessary kernel patches
2007-10-10 14:44:46 -05:00
Andrew Tridgell
e042002bb5 r21171: fixed a bug related to recursive event handling.
If this happens:

  - two sockets are readable, and select/epoll/aio returns both of
    them
  - read event on socket1 is called
  - inside that read event an event_loop_once is called, this returns that
    socket2 is readable
  - read event on socket2 is called
  - event_loop_once returns
  - top level event handler then calls read event on socket2 (as it
    still has that listed as readable)
  - read handler for socket2 returns zero byte read, which is
    interpreted as end of file
  - socket is incorrectly closed

this happened with ctdb, but it could happen anywhere (just
rarely). The fix is trivial - ensure we break out of the event loop
when we have been called recursively.
2007-10-10 14:44:41 -05:00
Andrew Tridgell
35f62bc125 r20989: don't mark epoll as set until after the io_submit() succeeds
this is part of the solution to LOCAL-EVENT on fort
2007-10-10 14:44:18 -05:00
Andrew Bartlett
aee751497c r20984: Try to ensure we can't have sig_state dissapear before se.
I think this happens when both are eventual children of the autofree context.

(Trying to track down a valgrind error on fort).

Andrew Bartlett
2007-10-10 14:44:17 -05:00
Andrew Tridgell
071a6e8eb1 r20960: attempt to fix a valgrind error in the signals backend.
This also reduces the static data in the signal backend when not using
signals to 4 bytes.
2007-10-10 14:44:03 -05:00
Andrew Tridgell
83353ec0cd r20941: avoid races in the block/unblock code 2007-10-10 14:43:56 -05:00
Andrew Tridgell
e892cbdb4b r20940: allow SA_SIGINFO signals to be oneshot. Why you would ever want this
is beyond me :-)
2007-10-10 14:43:56 -05:00