+/*
+ * It seems that pthreads and signals interact oddly in OpenBSD
+ * pthreads (and possibly FreeBSD). When linking with -lpthreads, we
+ * have to use pthread_kill to send blockable signals. So use that
+ * when we have a threaded rts. So System.Posix.Signals will call
+ * genericRaise(), rather than raise(3).
+ */
+#if defined(openbsd_TARGET_OS)
+int genericRaise(int sig) {
+# if defined(THREADED_RTS)
+ return pthread_kill(pthread_self(), sig);
+# else
+ return raise(sig);
+# endif
+}
+#endif