With FreeBSD 8.0 it seems like you can't block pending but undelivered signals

Richard Sharpe realrichardsharpe at gmail.com
Sun Jan 13 10:11:49 MST 2013


On Fri, Jan 11, 2013 at 5:24 PM, Jeremy Allison <jra at samba.org> wrote:
> On Wed, Jan 09, 2013 at 10:04:09AM -0800, Richard Sharpe wrote:
>> On Wed, Jan 9, 2013 at 8:59 AM, Jeremy Allison <jra at samba.org> wrote:
>> > On Wed, Jan 09, 2013 at 06:28:20AM -0800, Richard Sharpe wrote:
>> >
>> >
>> > Cool ! Let's work on getting a portable tested fix into tevent !
>>
>> OK, so we could test for the existence of ucontext_t as well as
>> SA_SIGINFO and only allow such signal handling if both exist.
>>
>> Ie, HAVE_UCONTEXT_T
>>
>> Linux has it, as does FreeBSD and I am told that Solaris has it.
>>
>> I wonder what other versions of UNIX have?
>
> Once we detect HAVE_UCONTEXT_T in tevent then I think
> this is the correct patch.

These might be the correct set of configure checks. My only concern is
that the AC_CHECK_HEADERS line I have used ends up defining both
HAVE_SYS_UCONTEXT_H and HAVE_UCONTEXT_T.

Hmmm, maybe the checking message should be clearer as well.

--------------------------------------------------------------------------------------------------------
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 684286d..c42490a 100755
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -41,6 +41,10 @@ def configure(conf):
             if conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversio
                 conf.define('USING_SYSTEM_PYTEVENT', 1)

+    conf.CHECK_HEADERS('sys/ucontext.h')
+    if "HAVE_SYS_UCONTEXT_H" in conf.env:
+       conf.DEFINE('HAVE_UCONTEXT_T', 1)
+
     if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
         conf.DEFINE('HAVE_EPOLL', 1)

diff --git a/source3/configure.in b/source3/configure.in
index bd3bffe..e657552 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -8,6 +8,7 @@ AC_INIT([Samba],[3],[samba-technical at samba.org])
 AC_CONFIG_SRCDIR([include/includes.h])
 AC_CONFIG_HEADER(include/autoconf/config.h)
 AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])
+AC_DEFINE(HAVE_UCONTEXT_T, [], [Whether we have ucontext_t at all])

 case "$PATH" in
     */usr/ucb*)
@@ -601,6 +602,7 @@ AC_CHECK_HEADERS(xfs/libxfs.h)
 AC_CHECK_HEADERS(netgroup.h)
 AC_CHECK_HEADERS(linux/falloc.h)
 AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
+AC_CHECK_HEADERS(sys/ucontext.h, [AC_DEFINE(HAVE_UCONTEXT_T)])

 dnl check for OS implementation of md5 conformant to rfc1321
 samba_cv_md5lib=none



-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list