diff --git a/folly/FileUtil.cpp b/folly/FileUtil.cpp index 2d9cabf872dab44c82095fbd24f30c09d787257d..4a4ca6b6264658c434e4707daeff7806b36fa973 100644 --- a/folly/FileUtil.cpp +++ b/folly/FileUtil.cpp @@ -53,10 +53,12 @@ int fsyncNoInt(int fd) { } int fdatasyncNoInt(int fd) { -#ifndef __APPLE__ - return wrapNoInt(fdatasync, fd); -#else +#if defined(__APPLE__) return wrapNoInt(fcntl, fd, F_FULLFSYNC); +#elif defined(__FreeBSD__) + return wrapNoInt(fsync, fd); +#else + return wrapNoInt(fdatasync, fd); #endif }