close.2: Note that future POSIX plans to require that the FD is closed on error

See http://austingroupbugs.net/view.php?id=529#c1200.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-12-07 08:28:29 +01:00
parent e8730f0ee7
commit d24623ee57
1 changed files with 11 additions and 3 deletions

View 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 ()