From: Eric Blake Date: Sat, 16 Aug 2008 19:47:58 +0000 (-0600) Subject: c-stack: fix regression on Irix 5.3 from 2008-06-21 X-Git-Tag: v0.1~7149 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=a3f953e86848ed858ed655bba12a7fbbab57f1c5;p=gnulib.git c-stack: fix regression on Irix 5.3 from 2008-06-21 * m4/c-stack.m4 (gl_PREREQ_C_STACK): Move check for sa_sigaction... * m4/sigaction.m4 (gl_PREREQ_SIG_HANDLER_H): ...here. (gl_PREREQ_SIGACTION): Depend on sig-handler.h prereq's. * m4/signal_h.m4 (gl_SIGNAL_H_DEFAULTS): Set the default. * modules/signal (Makefile.am): Use the value. * lib/signal.in.h (sa_sigaction) [HAVE_SIGACTION && !HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define. * doc/posix-headers/signal.texi (signal.h): Document this portability issue. * doc/posix-functions/sigaction.texi (sigaction): Likewise. Reported by Tom G. Christensen. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 2ec2e879d..062b03ec0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-08-16 Eric Blake + + c-stack: fix regression on Irix 5.3 from 2008-06-21 + * m4/c-stack.m4 (gl_PREREQ_C_STACK): Move check for + sa_sigaction... + * m4/sigaction.m4 (gl_PREREQ_SIG_HANDLER_H): ...here. + (gl_PREREQ_SIGACTION): Depend on sig-handler.h prereq's. + * m4/signal_h.m4 (gl_SIGNAL_H_DEFAULTS): Set the default. + * modules/signal (Makefile.am): Use the value. + * lib/signal.in.h (sa_sigaction) [HAVE_SIGACTION + && !HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define. + * doc/posix-headers/signal.texi (signal.h): Document this + portability issue. + * doc/posix-functions/sigaction.texi (sigaction): Likewise. + Reported by Tom G. Christensen. + 2008-08-17 Bruno Haible New module 'threadlib'. diff --git a/doc/posix-functions/sigaction.texi b/doc/posix-functions/sigaction.texi index 56795d900..c48519a67 100644 --- a/doc/posix-functions/sigaction.texi +++ b/doc/posix-functions/sigaction.texi @@ -37,6 +37,11 @@ Support for SA_RESTART is missing on some platforms: mingw. @item +In spite of having SA_SIGACTION, struct sigaction lacks the +sa_sigaction member on some platforms: +Irix 5.3. + +@item The symbolic value @code{SIG_IGN} for the @code{SIGCHLD} signal is equivalent to a signal handler @smallexample diff --git a/doc/posix-headers/signal.texi b/doc/posix-headers/signal.texi index cb4f580e8..924408992 100644 --- a/doc/posix-headers/signal.texi +++ b/doc/posix-headers/signal.texi @@ -15,12 +15,13 @@ mingw. @code{struct sigaction} and @code{siginfo_t} are missing on some platforms: mingw. + +@item +@code{struct sigaction} lacks the @code{sa_sigaction} member on some +platforms: +Irix 5.3, Interix 3.5. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -@code{struct sigaction} lacks the @code{sa_sigaction} member on some -platforms; this can also be detected by whether @code{SA_SIGINFO} is defined: -Interix 3.5. @end itemize diff --git a/lib/signal.in.h b/lib/signal.in.h index 703437d55..7df5d5f71 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -146,7 +146,11 @@ struct sigaction extern int sigaction (int, const struct sigaction *restrict, struct sigaction *restrict); -#endif /* !@HAVE_SIGACTION@ */ +#elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ + +# define sa_sigaction sa_handler + +#endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */ #ifdef __cplusplus diff --git a/m4/c-stack.m4 b/m4/c-stack.m4 index b1f93eda8..1db2a5065 100644 --- a/m4/c-stack.m4 +++ b/m4/c-stack.m4 @@ -7,7 +7,7 @@ # Written by Paul Eggert. -# serial 3 +# serial 4 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC], [# for STACK_DIRECTION @@ -146,8 +146,6 @@ AC_DEFUN([gl_PREREQ_C_STACK], AC_CHECK_HEADERS_ONCE([unistd.h ucontext.h]) - AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , , [#include ]) - AC_CHECK_TYPES([stack_t], , , [#include ]) dnl c-stack does not need -lsigsegv if the system has XSI heuristics. diff --git a/m4/sigaction.m4 b/m4/sigaction.m4 index 790116a04..f11d4cf0f 100644 --- a/m4/sigaction.m4 +++ b/m4/sigaction.m4 @@ -1,4 +1,4 @@ -# sigaction.m4 serial 3 +# sigaction.m4 serial 4 dnl Copyright (C) 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,6 +22,7 @@ AC_DEFUN([gl_PREREQ_SIGACTION], AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_TYPE_UID_T]) + AC_REQUIRE([gl_PREREQ_SIG_HANDLER_H]) AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt]) AC_CHECK_TYPES([siginfo_t], [], [], [[ #include @@ -36,5 +37,10 @@ AC_DEFUN([gl_PREREQ_SIGACTION], AC_DEFUN([gl_PREREQ_SIG_HANDLER_H], [ AC_REQUIRE([AC_C_INLINE]) - : + AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , , + [[#include ]]) + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) + fi ]) diff --git a/m4/signal_h.m4 b/m4/signal_h.m4 index bf2bad41e..0a1054708 100644 --- a/m4/signal_h.m4 +++ b/m4/signal_h.m4 @@ -1,4 +1,4 @@ -# signal_h.m4 serial 4 +# signal_h.m4 serial 5 dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,4 +26,6 @@ AC_DEFUN([gl_SIGNAL_H_DEFAULTS], HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T]) HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T]) HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION]) + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) ]) diff --git a/modules/signal b/modules/signal index afe6ab3b4..c4fccc5f9 100644 --- a/modules/signal +++ b/modules/signal @@ -28,6 +28,7 @@ signal.h: signal.in.h -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/signal.in.h; \ } > $@-t