3 ms·
In posix, you call "sync". Everything beyond that is workarounds for hardware and software level cheating. There are good reasons that modern filesystems aren't
by GauntletWizard 5y ago
In posix, you call "sync". Everything beyond that is workarounds for hardware and software level cheating. There are good reasons that modern filesystems aren't quite as simple as that, and some of those reasons are shameful, but it's not on POSIX.
Edit: I just reread the spec, and it is on POSIX: They recognized that "sync" was not actually writing, and documented the real usage. Unix 5 has this to say about sync:
> Sync causes all information in core memory that should be on disk to be written out..This includes modifi~ super blocks, modified i-nodes, and delayed block I/0.
> It should be used by programs which examine a file system, for example check, d.£ etc. It is mandatory before a boot.
But by System 6, Lion's book is already referring to the peculiarities of delayed writes.
- jmalicki 5y agoThere was also the entire fiasco where postgres and Linux kernel developers discovered it was damn-near impossible to get the intended behavior with fsync as there were way too many pitfalls, underspecification, and filesystem-level incompatibilities to know what happened in the non-happy case. https://www.postgresql.org/message-id/CAMsr+YHh+5Oq4xziwwoEfhoTZgr07vdGG+hu=1adXx59aTeaoQ@mail.gmail.com https://www.postgresql.org/message-id/CAMsr+YHh+5Oq4xziwwoEf...