From f090c9d06962930a4a782d0e78d71cababf0fdb7 Mon Sep 17 00:00:00 2001 From: bje Date: Mon, 30 Nov 2009 00:23:45 +0000 Subject: * 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 --- boehm-gc/ChangeLog | 6 ++++++ boehm-gc/os_dep.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'boehm-gc') diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 9f05a757d69..5b615d956a4 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/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/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index 3f0f20e834c..6f1e81abc16 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/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; -- cgit v1.2.1