From: Alejandro Colomar <alx@kernel.org>
Cc: Alejandro Colomar <alx@kernel.org>, Jan Kara <jack@suse.cz>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Rich Felker <dalias@libc.org>,
linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org,
libc-alpha@sourceware.org
Subject: [RFC v1] man/man2/close.2: CAVEATS: Document divergence from POSIX.1-2024
Date: Fri, 16 May 2025 14:52:05 +0200 [thread overview]
Message-ID: <efaffc5a404cf104f225c26dbc96e0001cede8f9.1747399542.git.alx@kernel.org> (raw)
In-Reply-To: <a5tirrssh3t66q4vpwpgmxgxaumhqukw5nyxd4x6bevh7mtuvy@wtwdsb4oloh4>
POSIX.1-2024 now mandates a behavior different from what Linux (and many
other implementations) does. It requires that we report EINPROGRESS for
what now is EINTR.
There are no plans to conform to POSIX.1-2024 within the Linux kernel,
so document this divergence. Keep POSIX.1-2008 as the standard to
which we conform in STANDARDS.
Link: <https://sourceware.org/bugzilla/show_bug.cgi?id=14627>
Link: <https://pubs.opengroup.org/onlinepubs/9799919799/functions/close.html>
Cc: Jan Kara <jack@suse.cz>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Rich Felker <dalias@libc.org>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: <linux-api@vger.kernel.org>
Cc: <libc-alpha@sourceware.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
Hi,
I've prepared this draft for discussion. While doing so, I've noticed
the glibc bug ticket, which sounds possibly reasonable: returning 0
instead of reporting an error on EINTR. That would be an option that
would make us conforming to POSIX.1-2024. And given that a user can
(and must) do nothing after seeing EINTR, returning 0 wouldn't change
things.
So, I'll leave this patch open for discussion.
Have a lovely day!
Alex
man/man2/close.2 | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/man/man2/close.2 b/man/man2/close.2
index b25ea4de9..9d5e26eed 100644
--- a/man/man2/close.2
+++ b/man/man2/close.2
@@ -191,10 +191,7 @@ .SS Dealing with error returns from close()
meaning that the file descriptor was invalid)
even if they subsequently report an error on return from
.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.
+POSIX.1-2008 was silent on this point.
.P
A careful programmer who wants to know about I/O errors may precede
.BR close ()
@@ -206,7 +203,7 @@ .SS Dealing with error returns from close()
error is a somewhat special case.
Regarding the
.B EINTR
-error, POSIX.1-2008 says:
+error, POSIX.1-2008 said:
.P
.RS
If
@@ -243,16 +240,10 @@ .SS Dealing with error returns from close()
error, and on at least one,
.BR close ()
must be called again.
-There are plans to address this conundrum for
-the next major release of the POSIX.1 standard.
-.\" FIXME . for later review when Issue 8 is one day released...
-.\" POSIX proposes further changes for EINTR
-.\" http://austingroupbugs.net/tag_view_page.php?tag_id=8
-.\" http://austingroupbugs.net/view.php?id=529
-.\"
-.\" FIXME .
-.\" Review the following glibc bug later
-.\" https://sourceware.org/bugzilla/show_bug.cgi?id=14627
+.P
+POSIX.1-2024 standardized the behavior of HP-UX,
+making Linux and many other implementations non-conforming.
+There are no plans to change the behavior on Linux.
.SH SEE ALSO
.BR close_range (2),
.BR fcntl (2),
Range-diff against v0:
-: --------- > 1: efaffc5a4 man/man2/close.2: CAVEATS: Document divergence from POSIX.1-2024
base-commit: 978b017d93e4e32b752b33877e44a8365644630c
--
2.49.0
next prev parent reply other threads:[~2025-05-16 12:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 21:33 close(2) with EINTR has been changed by POSIX.1-2024 Alejandro Colomar
2025-05-16 10:48 ` Jan Kara
2025-05-16 12:11 ` Alejandro Colomar
2025-05-16 12:52 ` Alejandro Colomar [this message]
2025-05-16 13:05 ` [RFC v1] man/man2/close.2: CAVEATS: Document divergence from POSIX.1-2024 Rich Felker
2025-05-16 14:20 ` Theodore Ts'o
2025-05-17 5:46 ` Alejandro Colomar
2025-05-17 13:03 ` Alejandro Colomar
2025-05-17 13:43 ` Rich Felker
2025-05-16 14:39 ` Vincent Lefevre
2025-05-16 14:52 ` Florian Weimer
2025-05-16 15:28 ` Vincent Lefevre
2025-05-16 15:28 ` Rich Felker
2025-05-17 13:32 ` Rich Felker
2025-05-17 13:46 ` Alejandro Colomar
2025-05-23 18:10 ` Zack Weinberg
2025-05-24 2:24 ` Rich Felker
2025-05-24 19:25 ` Florian Weimer
2025-05-16 12:41 ` close(2) with EINTR has been changed by POSIX.1-2024 Mateusz Guzik
2025-05-16 12:41 ` Theodore Ts'o
2025-05-19 23:19 ` Steffen Nurpmeso
2025-05-20 13:37 ` Theodore Ts'o
2025-05-20 23:16 ` Steffen Nurpmeso
2025-05-16 19:13 ` Al Viro
2025-05-19 9:48 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efaffc5a404cf104f225c26dbc96e0001cede8f9.1747399542.git.alx@kernel.org \
--to=alx@kernel.org \
--cc=brauner@kernel.org \
--cc=dalias@libc.org \
--cc=jack@suse.cz \
--cc=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).