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__)
20 /* Replacement of I/O. */
21 #include <sys/types.h>
27 #define open(pathname, flags, ...) \
28 failtest_open((pathname), (flags), __FILE__, __LINE__, __VA_ARGS__)
31 #define pipe(pipefd) \
32 failtest_pipe((pipefd), __FILE__, __LINE__)
35 #define read(fd, buf, count) \
36 failtest_read((fd), (buf), (count), __FILE__, __LINE__)
39 #define write(fd, buf, count) \
40 failtest_write((fd), (buf), (count), __FILE__, __LINE__)
43 #define close(fd) failtest_close(fd)
45 #include <ccan/failtest/failtest_proto.h>
47 #endif /* CCAN_FAILTEST_OVERRIDE_H */