mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
tevent: define TEVENT_NUM_SIGNALS based on configure checks
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
602cd7f6c6
commit
d5f9257108
@ -39,6 +39,35 @@ if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x
|
|||||||
AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
|
AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
tevent_num_signals_includes="$ac_includes_default
|
||||||
|
#include <signal.h>
|
||||||
|
"
|
||||||
|
tevent_num_signals=64
|
||||||
|
AC_CHECK_VALUEOF(NSIG, [$tevent_num_signals_includes])
|
||||||
|
v=$ac_cv_valueof_NSIG
|
||||||
|
test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
|
||||||
|
tevent_num_signals=$v
|
||||||
|
}
|
||||||
|
AC_CHECK_VALUEOF(_NSIG, [$tevent_num_signals_includes])
|
||||||
|
v=$ac_cv_valueof__NSIG
|
||||||
|
test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
|
||||||
|
tevent_num_signals=$v
|
||||||
|
}
|
||||||
|
AC_CHECK_VALUEOF(SIGRTMAX, [$tevent_num_signals_includes])
|
||||||
|
v=$ac_cv_valueof_SIGRTMAX
|
||||||
|
test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
|
||||||
|
tevent_num_signals=$v
|
||||||
|
}
|
||||||
|
AC_CHECK_VALUEOF(SIGRTMIN, [$tevent_num_signals_includes])
|
||||||
|
v=$ac_cv_valueof_SIGRTMIN
|
||||||
|
test -n "$v" && {
|
||||||
|
v=`expr $v + $v`
|
||||||
|
}
|
||||||
|
test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
|
||||||
|
tevent_num_signals=$v
|
||||||
|
}
|
||||||
|
AC_DEFINE_UNQUOTED(TEVENT_NUM_SIGNALS, $tevent_num_signals, [Max signal number value])
|
||||||
|
|
||||||
if test x"$VERSIONSCRIPT" != "x"; then
|
if test x"$VERSIONSCRIPT" != "x"; then
|
||||||
EXPORTSFILE=tevent.exports
|
EXPORTSFILE=tevent.exports
|
||||||
AC_SUBST(EXPORTSFILE)
|
AC_SUBST(EXPORTSFILE)
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#include "tevent_internal.h"
|
#include "tevent_internal.h"
|
||||||
#include "tevent_util.h"
|
#include "tevent_util.h"
|
||||||
|
|
||||||
#define TEVENT_NUM_SIGNALS 64
|
|
||||||
|
|
||||||
/* maximum number of SA_SIGINFO signals to hold in the queue.
|
/* maximum number of SA_SIGINFO signals to hold in the queue.
|
||||||
NB. This *MUST* be a power of 2, in order for the ring buffer
|
NB. This *MUST* be a power of 2, in order for the ring buffer
|
||||||
wrap to work correctly. Thanks to Petr Vandrovec <petr@vandrovec.name>
|
wrap to work correctly. Thanks to Petr Vandrovec <petr@vandrovec.name>
|
||||||
|
@ -44,6 +44,23 @@ def configure(conf):
|
|||||||
if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
|
if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
|
||||||
conf.DEFINE('HAVE_EPOLL', 1)
|
conf.DEFINE('HAVE_EPOLL', 1)
|
||||||
|
|
||||||
|
tevent_num_signals = 64
|
||||||
|
v = conf.CHECK_VALUEOF('NSIG', headers='signal.h')
|
||||||
|
if v is not None:
|
||||||
|
tevent_num_signals = max(tevent_num_signals, v)
|
||||||
|
v = conf.CHECK_VALUEOF('_NSIG', headers='signal.h')
|
||||||
|
if v is not None:
|
||||||
|
tevent_num_signals = max(tevent_num_signals, v)
|
||||||
|
v = conf.CHECK_VALUEOF('SIGRTMAX', headers='signal.h')
|
||||||
|
if v is not None:
|
||||||
|
tevent_num_signals = max(tevent_num_signals, v)
|
||||||
|
v = conf.CHECK_VALUEOF('SIGRTMIN', headers='signal.h')
|
||||||
|
if v is not None:
|
||||||
|
tevent_num_signals = max(tevent_num_signals, v*2)
|
||||||
|
|
||||||
|
if not conf.CONFIG_SET('USING_SYSTEM_TEVENT'):
|
||||||
|
conf.DEFINE('TEVENT_NUM_SIGNALS', tevent_num_signals)
|
||||||
|
|
||||||
conf.env.disable_python = getattr(Options.options, 'disable_python', False)
|
conf.env.disable_python = getattr(Options.options, 'disable_python', False)
|
||||||
|
|
||||||
if not conf.env.disable_python:
|
if not conf.env.disable_python:
|
||||||
|
Loading…
Reference in New Issue
Block a user