]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man2/close.2: Move part of NOTES into a new CAVEATS section
authorAlejandro Colomar <alx@kernel.org>
Fri, 16 May 2025 12:18:48 +0000 (14:18 +0200)
committerAlejandro Colomar <alx@kernel.org>
Sun, 27 Jul 2025 11:12:03 +0000 (13:12 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man2/close.2

index f7a26054f3f2a2a2db0779531c3fde42426e55ad..b75d2ef3f2922eee913ebb75863d49fbb311d5f3 100644 (file)
@@ -74,7 +74,7 @@ subsequent
 or
 .BR close ().
 .P
-See NOTES for a discussion of why
+See CAVEATS for a discussion of why
 .BR close ()
 should not be retried after an error.
 .SH STANDARDS
@@ -83,6 +83,13 @@ POSIX.1-2008.
 POSIX.1-2001, SVr4, 4.3BSD.
 .\" SVr4 documents an additional ENOLINK error condition.
 .SH NOTES
+The close-on-exec file descriptor flag can be used to ensure
+that a file descriptor is automatically closed upon a successful
+.BR execve (2);
+see
+.BR fcntl (2)
+for details.
+.SH CAVEATS
 A successful close does not guarantee that the data has been successfully
 saved to disk, as the kernel uses the buffer cache to defer writes.
 Typically, filesystems do not flush buffers when a file is closed.
@@ -90,13 +97,6 @@ If you need to be sure that
 the data is physically stored on the underlying disk, use
 .BR fsync (2).
 (It will depend on the disk hardware at this point.)
-.P
-The close-on-exec file descriptor flag can be used to ensure
-that a file descriptor is automatically closed upon a successful
-.BR execve (2);
-see
-.BR fcntl (2)
-for details.
 .\"
 .SS Multithreaded processes and close()
 It is probably unwise to close file descriptors while