Whamcloud - gitweb
libext2fs: force DIO alignment FreeBSD when operating on a block device
[tools/e2fsprogs.git] / lib / ext2fs / tdb.c
index 1d97685..b36c485 100644 (file)
@@ -36,7 +36,9 @@ Last Changed Date: 2007-06-22 13:36:10 -0400 (Fri, 22 Jun 2007)
 #define HAVE_UTIME_H
 #define HAVE_UTIME
 #endif
+#ifndef __FreeBSD__
 #define _XOPEN_SOURCE 600
+#endif
 
 #include "config.h"
 #include <unistd.h>
@@ -4142,3 +4144,13 @@ int tdb_reopen_all(int parent_longlived)
 
        return 0;
 }
+
+/**
+ * Flush a database file from the page cache.
+ **/
+int tdb_flush(struct tdb_context *tdb)
+{
+       if (tdb->fd != -1)
+               return fsync(tdb->fd);
+       return 0;
+}