$OpenBSD: patch-mono_utils_mono_semaphore_c,v 1.1 2012/04/13 11:51:49 robert Exp $
--- mono/utils/mono-semaphore.c.orig	Wed Apr 11 13:11:10 2012
+++ mono/utils/mono-semaphore.c	Wed Apr 11 13:11:29 2012
@@ -22,9 +22,6 @@
 #  ifdef USE_MACH_SEMA
 #    define TIMESPEC mach_timespec_t
 #    define WAIT_BLOCK(a,b) semaphore_timedwait (*(a), *(b))
-#  elif defined(__OpenBSD__)
-#    define TIMESPEC struct timespec
-#    define WAIT_BLOCK(a) sem_trywait(a)
 #  else
 #    define TIMESPEC struct timespec
 #    define WAIT_BLOCK(a,b) sem_timedwait (a, b)
@@ -37,9 +34,6 @@ mono_sem_timedwait (MonoSemType *sem, guint32 timeout_
 	TIMESPEC ts, copy;
 	struct timeval t;
 	int res = 0;
-#if defined(__OpenBSD__)
-	int timeout;
-#endif
 
 #ifndef USE_MACH_SEMA
 	if (timeout_ms == 0)
@@ -59,19 +53,6 @@ mono_sem_timedwait (MonoSemType *sem, guint32 timeout_
 		ts.tv_nsec -= NSEC_PER_SEC;
 		ts.tv_sec++;
 	}
-#if defined(__OpenBSD__)
-	timeout = ts.tv_sec;
-	while (timeout) {
-		if ((res = WAIT_BLOCK (sem)) == 0)
-			return res;
-
-		if (alertable)
-			return -1;
-
-		usleep (ts.tv_nsec / 1000);
-		timeout--;
-	}
-#else
 	copy = ts;
 	while ((res = WAIT_BLOCK (sem, &ts)) == -1 && errno == EINTR) {
 		struct timeval current;
@@ -98,7 +79,6 @@ mono_sem_timedwait (MonoSemType *sem, guint32 timeout_
 			ts.tv_nsec = 0;
 		}
 	}
-#endif
 	/* OSX might return > 0 for error */
 	if (res != 0)
 		res = -1;
