close.2: Clarify discussion noting that close() does not flush buffer cache

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-09-12 05:53:36 +01:00
parent f157f403de
commit fa1aa3502a
1 changed files with 3 additions and 4 deletions

View File

@ -106,11 +106,10 @@ should not be retried after an
since this may cause a reused file descriptor from another thread to be closed.
.PP
A successful close does not guarantee that the data has been successfully
saved to disk, as the kernel defers writes.
It is not common for a filesystem
to flush the buffers when the stream is closed.
saved to disk, as the kernel uses the buffer cache to defer writes.
Typically, filesystems do not flush buffers when a file is closed.
If you need to be sure that
the data is physically stored, use
the data is physically stored on the underlying disk, use
.BR fsync (2).
(It will depend on the disk hardware at this point.)
.PP