$OpenBSD$
--- src/ffitest.c.orig	Wed May 11 14:58:12 2005
+++ src/ffitest.c	Wed May 24 20:49:54 2006
@@ -27,6 +27,11 @@
 #include <string.h>
 #include <float.h>
 
+#if FFI_CLOSURES && defined(OPENBSD)
+#include <sys/types.h>
+#include <sys/mman.h>
+#endif
+
 /* This is lame. Long double support is barely there under SunOS 4.x  */
 #if defined(SPARC) && (SIZEOF_LONG_DOUBLE != 16)
 #define BROKEN_LONG_DOUBLE
@@ -1168,6 +1173,13 @@ int main(/*@unused@*/ int argc, /*@unuse
       object using direct function call.  */
    asm ("" : "=g" (pcl) : "0" (pcl));
 #  endif
+
+	{
+	  printf("FFI_TRAMPOLINE_SIZE=%d\n",FFI_TRAMPOLINE_SIZE);
+	  if( mprotect(pcl,0,PROT_EXEC|PROT_READ|PROT_WRITE) < 0 ) {
+		perror("mprotect");
+	  }
+	}
 
   /* A simple closure test */
     {
