1 #ifndef CCAN_FAILTEST_OVERRIDE_H
2 #define CCAN_FAILTEST_OVERRIDE_H
3 /* This file is included before the source file to test. */
6 /* Replacement of allocators. */
10 #define calloc(nmemb, size) \
11 failtest_calloc((nmemb), (size), __FILE__, __LINE__)
14 #define malloc(size) \
15 failtest_malloc((size), __FILE__, __LINE__)
18 #define realloc(ptr, size) \
19 failtest_realloc((ptr), (size), __FILE__, __LINE__)
25 /* Replacement of I/O. */
26 #include <sys/types.h>
32 #define open(pathname, ...) \
33 failtest_open((pathname), __FILE__, __LINE__, __VA_ARGS__)
36 #define pipe(pipefd) \
37 failtest_pipe((pipefd), __FILE__, __LINE__)
40 #define read(fd, buf, count) \
41 failtest_read((fd), (buf), (count), __FILE__, __LINE__)
44 #define write(fd, buf, count) \
45 failtest_write((fd), (buf), (count), __FILE__, __LINE__)
48 #define pread(fd, buf, count, off) \
49 failtest_pread((fd), (buf), (count), (off), __FILE__, __LINE__)
52 #define pwrite(fd, buf, count, off) \
53 failtest_pwrite((fd), (buf), (count), (off), __FILE__, __LINE__)
56 #define close(fd) failtest_close(fd, __FILE__, __LINE__)
59 #define fcntl(fd, ...) failtest_fcntl((fd), __FILE__, __LINE__, __VA_ARGS__)
61 #include <ccan/failtest/failtest_proto.h>
63 #endif /* CCAN_FAILTEST_OVERRIDE_H */