Use fcntl(..., F_FULLSYNC) if available
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 059637e592d2b8f6d9b5bff8617be961ca919c0f..9d977d34e0c45017ddd36ed3bb357ce62886e040 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -2297,7 +2297,11 @@ int do_io_u_sync(const struct thread_data *td, struct io_u *io_u)
        int ret;
 
        if (io_u->ddir == DDIR_SYNC) {
+#ifdef CONFIG_FCNTL_SYNC
+               ret = fcntl(io_u->file->fd, F_FULLSYNC);
+#else
                ret = fsync(io_u->file->fd);
+#endif
        } else if (io_u->ddir == DDIR_DATASYNC) {
 #ifdef CONFIG_FDATASYNC
                ret = fdatasync(io_u->file->fd);