Make fdatasync OS optional
[fio.git] / engines / sync.c
index 7c1cca63c700c4f318d1dd2003cc0fca5d52653f..c375e9a8ca8212b148920feaf0452ea6590d2e23 100644 (file)
@@ -162,9 +162,15 @@ static int fio_vsyncio_queue(struct thread_data *td, struct io_u *io_u)
 
                        return fio_io_end(td, io_u, ret);
                } else if (io_u->ddir == DDIR_DATASYNC) {
-                       int ret = fdatasync(io_u->file->fd);
-
+                       int ret;
+#ifdef FIO_HAVE_FDATASYNC
+                       ret = fdatasync(io_u->file->fd);
+#else
+                       ret = io_u->xfer_buflen;
+                       io_u->error = EINVAL;
+#endif
                        return fio_io_end(td, io_u, ret);
+                       
                }
        
                sd->queued = 0;