1 #ifndef CCAN_FAILTEST_OVERRIDE_H
2 #define CCAN_FAILTEST_OVERRIDE_H
3 /* This file is included before the source file to test. */
5 /* Replacement of allocators. */
9 #define calloc(nmemb, size) \
10 failtest_calloc((nmemb), (size), __FILE__, __LINE__)
13 #define malloc(size) \
14 failtest_malloc((size), __FILE__, __LINE__)
17 #define realloc(ptr, size) \
18 failtest_realloc((ptr), (size), __FILE__, __LINE__)
24 /* Replacement of I/O. */
25 #include <sys/types.h>
31 #define open(pathname, ...) \
32 failtest_open((pathname), __FILE__, __LINE__, __VA_ARGS__)
35 #define pipe(pipefd) \
36 failtest_pipe((pipefd), __FILE__, __LINE__)
39 #define read(fd, buf, count) \
40 failtest_read((fd), (buf), (count), __FILE__, __LINE__)
43 #define write(fd, buf, count) \
44 failtest_write((fd), (buf), (count), __FILE__, __LINE__)
47 #define pread(fd, buf, count, off) \
48 failtest_pread((fd), (buf), (count), (off), __FILE__, __LINE__)
51 #define pwrite(fd, buf, count, off) \
52 failtest_pwrite((fd), (buf), (count), (off), __FILE__, __LINE__)
55 #define close(fd) failtest_close(fd, __FILE__, __LINE__)
58 #define fcntl(fd, ...) failtest_fcntl((fd), __FILE__, __LINE__, __VA_ARGS__)
60 #include <ccan/failtest/failtest_proto.h>
62 #endif /* CCAN_FAILTEST_OVERRIDE_H */