-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Description
I tried looking in the Node and libuv source but was unable to confirm whether fs.fsync() does in fact do F_FULLFSYNC on darwin?
According to http://xiayubin.com/blog/2014/06/20/does-fsync-ensure-data-persistency-when-disk-cache-is-enabled/ as of 14.04 Ubuntu has moved to a stronger fsync that includes writing through or flushing a disk cache if present.
To do this on darwin requires F_FULLFSYNC. Otherwise a Node app may call fsync with nothing actually being flushed to disk on darwin systems.
Obviously, fsync will always be broken on older operating systems, but at least the tendency is to move towards making stronger guarantees, not the other way round.