• dgrogan@chromium.org's avatar
    Do fcntl(...F_FULLFSYNC...) on mac instead of fsync · 62904287
    dgrogan@chromium.org authored
    From mac's fsync man page:
    
    For applications that require tighter guarantees about the integrity of their
    data, Mac OS X provides the F_FULLFSYNC fcntl.  The F_FULLFSYNC fcntl asks the
    drive to flush all buffered data to permanent storage.  Applications, such as
    databases, that require a strict ordering of writes should use F_FULLFSYNC to
    ensure that their data is written in the order they expect.
    
    Also, specifically check for a return value of -1 from fdatasync. mac's fcntl
    only guarantees to return -1 on error and something other than -1 on success.
    All other platforms agree to return -1 on error for fsync/fdatasync/_commit.
    
    Review URL: https://chromiumcodereview.appspot.com/23549017
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221413 0039d316-1c4b-4281-b951-d872f2087c98
    62904287
env_chromium.cc 28.5 KB