summaryrefslogtreecommitdiff
path: root/boehm-gc/os_dep.c
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 00:23:45 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 00:23:45 +0000
commitf090c9d06962930a4a782d0e78d71cababf0fdb7 (patch)
tree9d5d70e132e325c2c358b0f3566007dcf4622867 /boehm-gc/os_dep.c
parent3dd6223b949243ed9a67f1a7680c4a3cd883c8c6 (diff)
downloadgcc-f090c9d06962930a4a782d0e78d71cababf0fdb7.tar.gz
* 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
Diffstat (limited to 'boehm-gc/os_dep.c')
-rw-r--r--boehm-gc/os_dep.c14
1 files changed, 8 insertions, 6 deletions
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;