failtest_undo.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Licensed under LGPL - see LICENSE file for details */
  2. #ifndef CCAN_FAILTEST_RESTORE_H
  3. #define CCAN_FAILTEST_RESTORE_H
  4. /* This file undoes the effect of failtest_override.h. */
  5. #undef calloc
  6. #define calloc(nmemb, size) \
  7. failtest_calloc((nmemb), (size), NULL, 0)
  8. #undef malloc
  9. #define malloc(size) \
  10. failtest_malloc((size), NULL, 0)
  11. #undef realloc
  12. #define realloc(ptr, size) \
  13. failtest_realloc((ptr), (size), NULL, 0)
  14. #undef open
  15. #define open(pathname, ...) \
  16. failtest_open((pathname), NULL, 0, __VA_ARGS__)
  17. #undef pipe
  18. #define pipe(pipefd) \
  19. failtest_pipe((pipefd), NULL, 0)
  20. #undef read
  21. #define read(fd, buf, count) \
  22. failtest_read((fd), (buf), (count), NULL, 0)
  23. #undef write
  24. #define write(fd, buf, count) \
  25. failtest_write((fd), (buf), (count), NULL, 0)
  26. #undef mmap
  27. #define mmap(addr, length, prot, flags, fd, offset) \
  28. failtest_mmap((addr), (length), (prot), (flags), (fd), (offset), NULL, 0)
  29. #undef lseek
  30. #define lseek(fd, off, whence) \
  31. failtest_lseek((fd), (off), (whence), NULL, 0)
  32. #undef close
  33. #define close(fd) failtest_close(fd)
  34. #undef fcntl
  35. #define fcntl(fd, ...) \
  36. failtest_fcntl((fd), NULL, 0, __VA_ARGS__)
  37. #endif /* CCAN_FAILTEST_RESTORE_H */