$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_signals_c,v 1.3 2007/07/18 14:19:27 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/green_threads/src/signals.c.orig	Wed Jul 18 09:36:12 2007
+++ j2sdk1.3.1/src/solaris/hpi/green_threads/src/signals.c	Wed Jul 18 09:36:14 2007
@@ -29,7 +29,6 @@
 #include "schedule.h"
 #include "signals.h"
 #include "iomgr.h"      	/* For io lock */
-#include "bsdmisc.h"
 
 /*
  * Local variables.
@@ -578,6 +577,7 @@ restart:
 #ifdef CATCH_SIGMASK_CHANGES
 
 #include <dlfcn.h>
+#include "bsdmisc.h"
 
 /*
  * The following functions, interposed in front of sigprocmask and
@@ -595,7 +595,7 @@ green_sigprocmask(int how, const sigset_t *set, sigset
 
     if (func == NULL) {
 #ifndef RTLD_NEXT
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
         void *dlMain = dlopen("libc.so", RTLD_LAZY);
 	func = (fn_t *)dlsym(dlMain, 
 #if defined(__NetBSD__)
@@ -608,6 +608,9 @@ green_sigprocmask(int how, const sigset_t *set, sigset
         dlMain = dlopen("/lib/libc.so.6", RTLD_LAZY);
         func = (fn_t *)dlsym(dlMain, BSD_C_SYM("__sigprocmask"));
 #endif
+#elif defined(__OpenBSD__)
+        void *dlMain = dlopen("libc.so", RTLD_LAZY);
+        func = (fn_t *)dlsym(dlMain, BSD_C_SYM("sigprocmask"));
 #elif defined(__solaris__)
         func = (fn_t *)dlsym(RTLD_NEXT, BSD_C_SYM("_sigprocmask"));
 #else
