#include <sys/time.h>
/*
- * Define the membarrier system call number if not yet available in the
- * system headers. aarch64 implements asm-generic/unistd.h system call
+ * On Linux, define the membarrier system call number if not yet available in
+ * the system headers. aarch64 implements asm-generic/unistd.h system call
* numbers.
*/
-#ifndef __NR_membarrier
+#if (defined(__linux__) && !defined(__NR_membarrier))
#define __NR_membarrier 283
#endif