mirror of https://github.com/mkerrisk/man-pages
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:
parent
f157f403de
commit
fa1aa3502a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue