failtest: compile fix for OpenBSD
[ccan] / ccan / failtest / failtest_override.h
index 204494b086cd380cd7916e7aace2babb3ecbba30..b056d538d482d31216b4dab492cb50fae5d9d7fd 100644 (file)
 #define fcntl(fd, ...) failtest_fcntl((fd), __FILE__, __LINE__, __VA_ARGS__)
 
 #undef mmap
+/* OpenBSD doesn't idempotent-protect sys/mman.h, so we can't add args. */
+#ifdef __OpenBSD__
+#define mmap(addr, length, prot, flags, fd, offset)                    \
+       failtest_mmap_noloc((addr), (length), (prot), (flags), (fd), (offset))
+#else
 #define mmap(addr, length, prot, flags, fd, offset)                    \
        failtest_mmap((addr), (length), (prot), (flags), (fd), (offset), \
                      __FILE__, __LINE__)
+#endif /* !__OpenBSD__ */
 
 #undef lseek
 #define lseek(fd, offset, whence)                                      \