--- src/x86_64/setcontext.S.orig	2012-10-06 04:54:38 UTC
+++ src/x86_64/setcontext.S
@@ -29,7 +29,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
 #include <asm/unistd.h>
 #define	SIG_SETMASK   2
 #define	SIGSET_BYTE_SIZE   (64/8)
-#elif defined __FreeBSD__
+#elif defined __FreeBSD__ || defined __BSDSUniX__
 #include <sys/syscall.h>
 #endif
 
@@ -60,7 +60,7 @@ _Ux86_64_setcontext:
 	mov    UC_MCONTEXT_FPREGS_PTR(%rdi),%r8
 	fldenv (%r8)
 	ldmxcsr FPREGS_OFFSET_MXCSR(%r8)
-#elif defined __FreeBSD__
+#elif defined __FreeBSD__ || defined __BSDSUniX__
 	/* restore signal mask */
 	pushq	%rdi
 	xorl	%edx,%edx
