]> git.ozlabs.org Git - ccan/blobdiff - ccan/failtest/failtest_override.h
check_type: fix incorrect documentation.
[ccan] / ccan / failtest / failtest_override.h
index dfcc62e0dd5f4ff5630cc727230a1361ce09ca0c..204494b086cd380cd7916e7aace2babb3ecbba30 100644 (file)
@@ -1,7 +1,11 @@
+/* Licensed under LGPL - see LICENSE file for details */
 #ifndef CCAN_FAILTEST_OVERRIDE_H
 #define CCAN_FAILTEST_OVERRIDE_H
 /* This file is included before the source file to test. */
 #include "config.h"
+#if HAVE_FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
 
 /* Replacement of allocators. */
 #include <stdlib.h>
@@ -25,6 +29,7 @@
 /* Replacement of I/O. */
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
 #undef fcntl
 #define fcntl(fd, ...) failtest_fcntl((fd), __FILE__, __LINE__, __VA_ARGS__)
 
+#undef mmap
+#define mmap(addr, length, prot, flags, fd, offset)                    \
+       failtest_mmap((addr), (length), (prot), (flags), (fd), (offset), \
+                     __FILE__, __LINE__)
+
+#undef lseek
+#define lseek(fd, offset, whence)                                      \
+       failtest_lseek((fd), (offset), (whence), __FILE__, __LINE__)
+
 /* Replacement of getpid (since failtest will fork). */
 #undef getpid
 #define getpid() failtest_getpid(__FILE__, __LINE__)