From 6d6fb45a3b50b686551c35baa3301cd27f1ce222 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Sat, 22 Oct 2016 23:14:50 -0400 Subject: [PATCH] check if fdatasync is available and return ENOSYS if not --- src/fs_base_fsync.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fs_base_fsync.hpp b/src/fs_base_fsync.hpp index 53dfcd40..61b9a2ad 100644 --- a/src/fs_base_fsync.hpp +++ b/src/fs_base_fsync.hpp @@ -16,6 +16,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include namespace fs @@ -33,6 +34,10 @@ namespace fs int fdatasync(const int fd) { +#if _POSIX_SYNCHRONIZED_IO > 0 return ::fdatasync(fd); +#else + return (errno=ENOSYS,-1); +#endif } }