1 #define _XOPEN_SOURCE 500
2 #include <ccan/tdb/tdb.h>
3 #include <ccan/tdb/io.c>
4 #include <ccan/tdb/tdb.c>
5 #include <ccan/tdb/lock.c>
6 #include <ccan/tdb/freelist.c>
7 #include <ccan/tdb/traverse.c>
8 #include <ccan/tdb/transaction.c>
9 #include <ccan/tdb/error.c>
10 #include <ccan/tdb/open.c>
11 #include <ccan/tdb/check.c>
12 #include <ccan/tdb/hash.c>
13 #include <ccan/tap/tap.h>
17 static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...)
19 unsigned int *count = tdb_get_logging_private(tdb);
20 if (strstr(fmt, "spinlocks"))
24 /* The code should barf on TDBs created with rwlocks. */
25 int main(int argc, char *argv[])
27 struct tdb_context *tdb;
28 unsigned int log_count;
29 struct tdb_logging_context log_ctx = { log_fn, &log_count };
33 /* We should fail to open rwlock-using tdbs of either endian. */
35 tdb = tdb_open_ex("test/rwlock-le.tdb", 0, 0, O_RDWR, 0,
41 tdb = tdb_open_ex("test/rwlock-be.tdb", 0, 0, O_RDWR, 0,