X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ffailtest%2Ffailtest_override.h;h=204494b086cd380cd7916e7aace2babb3ecbba30;hp=0d71312c4a63f2820214231ea804988f30cd106f;hb=56023cca5f66a40646a1e807c3d10af6e5913623;hpb=74257cee33ae3033f961d5f22a0313b8cb1b18d4 diff --git a/ccan/failtest/failtest_override.h b/ccan/failtest/failtest_override.h index 0d71312c..204494b0 100644 --- a/ccan/failtest/failtest_override.h +++ b/ccan/failtest/failtest_override.h @@ -3,6 +3,9 @@ #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 @@ -26,6 +29,7 @@ /* Replacement of I/O. */ #include #include +#include #include #include @@ -59,6 +63,15 @@ #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__)