projects
/
ccan
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tdb2: tdb_foreach()
[ccan]
/
ccan
/
failtest
/
failtest_override.h
diff --git
a/ccan/failtest/failtest_override.h
b/ccan/failtest/failtest_override.h
index dd328b508a5433911888affaa0f4e73227fdd67c..eee45ff17682332720285763255ee2a57e0ca435 100644
(file)
--- a/
ccan/failtest/failtest_override.h
+++ b/
ccan/failtest/failtest_override.h
@@
-1,6
+1,11
@@
+/* Licensed under LGPL - see LICENSE file for details */
#ifndef CCAN_FAILTEST_OVERRIDE_H
#define CCAN_FAILTEST_OVERRIDE_H
/* This file is included before the source file to test. */
#ifndef CCAN_FAILTEST_OVERRIDE_H
#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 <stdlib.h>
/* Replacement of allocators. */
#include <stdlib.h>
@@
-17,6
+22,10
@@
#define realloc(ptr, size) \
failtest_realloc((ptr), (size), __FILE__, __LINE__)
#define realloc(ptr, size) \
failtest_realloc((ptr), (size), __FILE__, __LINE__)
+#undef free
+#define free(ptr) \
+ failtest_free(ptr)
+
/* Replacement of I/O. */
#include <sys/types.h>
#include <sys/stat.h>
/* Replacement of I/O. */
#include <sys/types.h>
#include <sys/stat.h>
@@
-24,8
+33,8
@@
#include <unistd.h>
#undef open
#include <unistd.h>
#undef open
-#define open(pathname,
flags,
...) \
- failtest_open((pathname),
(flags),
__FILE__, __LINE__, __VA_ARGS__)
+#define open(pathname, ...) \
+ failtest_open((pathname), __FILE__, __LINE__, __VA_ARGS__)
#undef pipe
#define pipe(pipefd) \
#undef pipe
#define pipe(pipefd) \
@@
-39,8
+48,23
@@
#define write(fd, buf, count) \
failtest_write((fd), (buf), (count), __FILE__, __LINE__)
#define write(fd, buf, count) \
failtest_write((fd), (buf), (count), __FILE__, __LINE__)
+#undef pread
+#define pread(fd, buf, count, off) \
+ failtest_pread((fd), (buf), (count), (off), __FILE__, __LINE__)
+
+#undef pwrite
+#define pwrite(fd, buf, count, off) \
+ failtest_pwrite((fd), (buf), (count), (off), __FILE__, __LINE__)
+
#undef close
#undef close
-#define close(fd) failtest_close(fd)
+#define close(fd) failtest_close(fd, __FILE__, __LINE__)
+
+#undef fcntl
+#define fcntl(fd, ...) failtest_fcntl((fd), __FILE__, __LINE__, __VA_ARGS__)
+
+/* Replacement of getpid (since failtest will fork). */
+#undef getpid
+#define getpid() failtest_getpid(__FILE__, __LINE__)
#include <ccan/failtest/failtest_proto.h>
#include <ccan/failtest/failtest_proto.h>