diff options
Diffstat (limited to 'util/osdep.c')
-rw-r--r-- | util/osdep.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/util/osdep.c b/util/osdep.c index 1ea2398..c7aec36 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -607,3 +607,19 @@ writev(int fd, const struct iovec *iov, int iov_cnt) return readv_writev(fd, iov, iov_cnt, true); } #endif + +/* + * Make sure data goes on disk, but if possible do not bother to + * write out the inode just for timestamp updates. + * + * Unfortunately even in 2009 many operating systems do not support + * fdatasync and have to fall back to fsync. + */ +int qemu_fdatasync(int fd) +{ +#ifdef CONFIG_FDATASYNC + return fdatasync(fd); +#else + return fsync(fd); +#endif +} |