On 31 Oct 2000, Gary Howland wrote:

> Just a quickie - I heard that linux does not have a working fsync() call

At least the manpage for fsync says that it does.

The implementation:

        /* .. finally sync the buffers to disk */
        dev = inode->i_dev;
        return sync_buffers(dev, 1);

It really looks like it IS implemented. But probably on Linux not just the
file data/metadata is synced, also all that device's data, which makes it
very inefficient, but presumably `safe'.

NB: don't forget that fsync() merely ensures that data was sent to the
disk controller. Maybe this one has a cache (e.g. a fast SCSI harddrive),
and if power fails, well. If fsync() was calling the SCSI FLUSH command,
maybe that could be done, but that would not just sync the file.



Reply via email to