]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
close.2: Note that future POSIX plans to require that the FD is closed on error
authorMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 7 Dec 2016 07:28:29 +0000 (08:28 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 7 Dec 2016 07:28:29 +0000 (08:28 +0100)
See http://austingroupbugs.net/view.php?id=529#c1200.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/close.2

index 350e7a74a856c95a6c56f03345946554713ce872..a568534d31231301ef286c7f91cef40f28e907c0 100644 (file)
@@ -128,11 +128,19 @@ the steps that may return an error,
 .\" filp_close()
 such as flushing data to the filesystem or device,
 occur only later in the close operation.
-(Several other implementations similarly always close the file descriptor,
-.\" FreeBSD documents this explitly. From the look of the source code
+
+Many other implementations similarly always close the file descriptor
+.\" FreeBSD documents this explicitly. From the look of the source code
 .\" SVR4, ancient SunOS, later Solaris, and AIX all do this.
+(except in the case of
+.BR EBADF ,
+meaning that the file descriptor was invalid)
 even if they subsequently report an error on return from
-.BR close ().)
+.BR close ().
+POSIX.1 is currently silent on this point,
+but there are plans to mandate this behavior in the next major release
+.\" Issue 8
+of the standard
 
 A careful programmer who wants to know about I/O errors may precede
 .BR close ()