From 226cb3ac90720cd39167e627d2018487e1d2b0a1 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 19 Aug 2019 20:41:02 +0300 Subject: [PATCH] mdbx: use F_FULLFSYNC on MacOS. --- src/osal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osal.c b/src/osal.c index 4988c04c..cd197f9e 100644 --- a/src/osal.c +++ b/src/osal.c @@ -664,6 +664,9 @@ int mdbx_filesync(mdbx_filehandle_t fd, bool filesize_changed) { #if defined(_WIN32) || defined(_WIN64) (void)filesize_changed; return FlushFileBuffers(fd) ? MDBX_SUCCESS : GetLastError(); +#elif defined(__APPLE__) + (void)filesize_changed; + return likely(fcntl(fd, F_FULLFSYNC) != -1) ? MDBX_SUCCESS : errno; #else int rc; do {