fixed build freebsd/osx with fdatasync