4 ms·
fsync(2) on OS X and other Darwins also does not sync metadata. You need to use fcntl(2) with F_FULLFSYNC for that.
by valleyer 11y ago
fsync(2) on OS X and other Darwins also does not sync metadata. You need to use fcntl(2) with F_FULLFSYNC for that.
- ryao 11y agoIt looks like doing `sysctl -w kern.always_do_fullfsync=1` Will produce a sane behavior: https://opensource.apple.com/source/xnu/xnu-2422.1.72/bsd/hfs/hfs_vnops.c https://opensource.apple.com/source/xnu/xnu-2422.1.72/bsd/hf... Alternatively, you could just use the ZFS driver for Mac OS X. It will do fsync properly.