4 ms·
No. (and it's only a dumb question if you don't ask) close() flushes the application buffer into the vfs buffer, but it does not guarantee the vfs buffer is fl
by nwallin 7y ago
No. (and it's only a dumb question if you don't ask)
close() flushes the application buffer into the vfs buffer, but it does not guarantee the vfs buffer is flushed to the disk buffer, nor does it guarantee the disk buffer flushes to disk. A successful fsync() call guarantees these things.\*
\* except if the disk drive controller lies about flushing its buffer to disk, but there's nothing you can do about that besides buying a better disk.
- zAy0LfpBZLC8mAC 7y ago> close() flushes the application buffer into the vfs buffer No, close() only closes the file descriptor. fclose() potentially also flushes a userspace buffer.