From a5901ac39b8631915468a087af6de3af52c638ef Mon Sep 17 00:00:00 2001 From: bje Date: Mon, 30 Nov 2009 00:23:45 +0000 Subject: [PATCH] * os_dep.c: Use the POSIX signal API in preference to the BSD API. Generate a compilation error if neither the POSIX nor BSD APIs can be detected. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154747 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog | 6 ++++++ os_dep.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f05a757..5b615d95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-30 Ben Elliston + + * os_dep.c: Use the POSIX signal API in preference to the BSD API. + Generate a compilation error if neither the POSIX nor BSD APIs can + be detected. + 2009-09-11 Ralf Wildenhues * Makefile.am (libgcjgc_la_LINK, gctest_LINK): New. diff --git a/os_dep.c b/os_dep.c index 3f0f20e8..6f1e81ab 100644 --- a/os_dep.c +++ b/os_dep.c @@ -501,7 +501,13 @@ void GC_enable_signals(void) && !defined(MACOS) && !defined(DJGPP) && !defined(DOS4GW) \ && !defined(NOSYS) && !defined(ECOS) -# if defined(sigmask) && !defined(UTS4) && !defined(HURD) +# if defined(SIG_BLOCK) + /* Use POSIX/SYSV interface */ +# define SIGSET_T sigset_t +# define SIG_DEL(set, signal) sigdelset(&(set), (signal)) +# define SIG_FILL(set) sigfillset(&set) +# define SIGSETMASK(old, new) sigprocmask(SIG_SETMASK, &(new), &(old)) +# elif defined(sigmask) && !defined(UTS4) && !defined(HURD) /* Use the traditional BSD interface */ # define SIGSET_T int # define SIG_DEL(set, signal) (set) &= ~(sigmask(signal)) @@ -511,11 +517,7 @@ void GC_enable_signals(void) /* a signal 32. */ # define SIGSETMASK(old, new) (old) = sigsetmask(new) # else - /* Use POSIX/SYSV interface */ -# define SIGSET_T sigset_t -# define SIG_DEL(set, signal) sigdelset(&(set), (signal)) -# define SIG_FILL(set) sigfillset(&set) -# define SIGSETMASK(old, new) sigprocmask(SIG_SETMASK, &(new), &(old)) +# error undetectable signal API # endif static GC_bool mask_initialized = FALSE; -- 2.40.0