Martijn van Oosterhout <kleptog@svana.org> writes:
>> [sync before fsync]
> Not a good idea on some systems. From the linux sync(2) manpage:
> BUGS
> According to the standard specification (e.g., SVID), sync()
> schedules the writes, but may return before the actual writing
> is done. However, since version 1.3.20 Linux does actually
> wait.
This is another reason why it would have to be optional: the win comes
only if the kernel adheres literally to the SVID specification for
sync(2). I think all the BSDen do, and HPUX seems to, but there are
undoubtedly platforms that don't.
regards, tom lane