* Re: [PATCH] man/man2/socket.2: Mention POSIX.1-2024 added SOCK_NONBLOCK, SOCK_CLOEXEC, SOCK_CLOFORK.
2025-05-23 3:58 [PATCH] man/man2/socket.2: Mention POSIX.1-2024 added SOCK_NONBLOCK, SOCK_CLOEXEC, SOCK_CLOFORK Collin Funk
@ 2025-05-24 18:03 ` Alejandro Colomar
2025-05-24 18:08 ` Collin Funk
0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Colomar @ 2025-05-24 18:03 UTC (permalink / raw)
To: Collin Funk; +Cc: linux-man
[-- Attachment #1: Type: text/plain, Size: 5803 bytes --]
Hi Collin!
On Thu, May 22, 2025 at 08:58:50PM -0700, Collin Funk wrote:
> Signed-off-by: Collin Funk <collin.funk1@gmail.com>
I've applied a similar patch already. :)
I've pushed all of the work-in-progress POSIX.1-2024-related patches in
a branch to avoid collisions. There you can see my work. (Be warned
that I'll rebase that branch every now and then, and eventually remove
it when I merge it.)
> ---
> man/man2/socket.2 | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/man/man2/socket.2 b/man/man2/socket.2
> index 01b125fa0..b626ded8d 100644
> --- a/man/man2/socket.2
> +++ b/man/man2/socket.2
> @@ -422,13 +422,24 @@ .SH ERRORS
> .SH STANDARDS
> POSIX.1-2008.
> .P
> -.B SOCK_NONBLOCK
> +The
> +.BR SOCK_NONBLOCK
> and
> -.B SOCK_CLOEXEC
> -are Linux-specific.
> +.BR SOCK_CLOEXEC
> +flags are specified by POSIX.1-2024.
> +.P
> +The
> +.BR SOCK_CLOFORK
> +flag is also specified by POSIX.1-2024 but is not implemented by Linux.
About SOCK_CLOFORK, I've done this:
alx@devuan:/srv/alx/src/linux/man-pages/man-pages/posix24$ git show a9d2a00ed3e2
commit a9d2a00ed3e2d4128b1d0f5a30853682cb53fe5d
Author: Alejandro Colomar <alx@kernel.org>
Date: Sat May 17 19:26:44 2025 +0200
man/man2/socket.2: VERSIONS: POSIX.1-2024 specifies SOCK_CLOFORK, but Linux doesn't support it
Fixes: 265b9898dfe2 (2025-05-09; "man/man2/: VERSIONS: POSIX.1-2024 specifies *_CLOFORK, but Linux doesn't support it")
Link: <https://lore.kernel.org/all/20200515160342.GE23230@ZenIV.linux.org.uk/>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
diff --git a/man/man2/socket.2 b/man/man2/socket.2
index 01b125fa0..d80508248 100644
--- a/man/man2/socket.2
+++ b/man/man2/socket.2
@@ -419,6 +419,10 @@ .SH ERRORS
supported within this domain.
.P
Other errors may be generated by the underlying protocol modules.
+.SH VERSIONS
+POSIX.1-2024 specifies
+.BR SOCK_CLOFORK ,
+but Linux doesn't support it.
.SH STANDARDS
POSIX.1-2008.
.P
which results in
$ diffman-git a9d2a00ed3e2
--- a9d2a00ed3e2^:man/man2/socket.2
+++ a9d2a00ed3e2:man/man2/socket.2
@@ -196,6 +196,9 @@
Other errors may be generated by the underlying protocol modules.
+VERSIONS
+ POSIX.1‐2024 specifies SOCK_CLOFORK, but Linux doesn’t support it.
+
STANDARDS
POSIX.1‐2008.
> .SH HISTORY
> POSIX.1-2001, 4.4BSD.
> .P
> +The
> +.BR SOCK_NONBLOCK
> +and
> +.BR SOCK_CLOEXEC
> +flags were originally Linux extensions.
> +.P
About SOCK_NONBLOCK and SOCK_CLOEXEC I've applied this:
alx@devuan:/srv/alx/src/linux/man-pages/man-pages/posix24$ git show e78e3a82d85f -- man/man2/socket.2
commit e78e3a82d85ffb3a3b076f352b5d2c7806e28c67
Author: Alejandro Colomar <alx@kernel.org>
Date: Mon Apr 14 22:16:10 2025 +0200
man/man2/: STANDARDS: Update system calls for POSIX.1-2024
Signed-off-by: Alejandro Colomar <alx@kernel.org>
diff --git a/man/man2/socket.2 b/man/man2/socket.2
index d80508248..7c0a5c2f6 100644
--- a/man/man2/socket.2
+++ b/man/man2/socket.2
@@ -424,17 +424,10 @@ .SH VERSIONS
.BR SOCK_CLOFORK ,
but Linux doesn't support it.
.SH STANDARDS
-POSIX.1-2008.
-.P
-.B SOCK_NONBLOCK
-and
-.B SOCK_CLOEXEC
-are Linux-specific.
+POSIX.1-2024.
.SH HISTORY
-POSIX.1-2001, 4.4BSD.
+POSIX.1-2001, 4.2BSD.
.P
-.BR socket ()
-appeared in 4.2BSD.
It is generally portable to/from
non-BSD systems supporting clones of the BSD socket layer (including
System\ V variants).
@@ -451,6 +444,11 @@ .SH HISTORY
However, already the BSD man page promises: "The protocol
family generally is the same as the address family", and subsequent
standards use AF_* everywhere.
+.TP
+.B SOCK_NONBLOCK
+.TQ
+.B SOCK_CLOEXEC
+POSIX.1-2024.
.SH EXAMPLES
An example of the use of
.BR socket ()
which results in
$ MANWIDTH=72 diffman-git -U4 e78e3a82d85f | grep -A34 man/man2/socket.2;
--- e78e3a82d85f^:man/man2/socket.2
+++ e78e3a82d85f:man/man2/socket.2
@@ -200,25 +200,26 @@
VERSIONS
POSIX.1‐2024 specifies SOCK_CLOFORK, but Linux doesn’t support it.
STANDARDS
- POSIX.1‐2008.
-
- SOCK_NONBLOCK and SOCK_CLOEXEC are Linux‐specific.
+ POSIX.1‐2024.
HISTORY
- POSIX.1‐2001, 4.4BSD.
+ POSIX.1‐2001, 4.2BSD.
- socket() appeared in 4.2BSD. It is generally portable to/from
- non‐BSD systems supporting clones of the BSD socket layer (includ‐
- ing System V variants).
+ It is generally portable to/from non‐BSD systems supporting clones
+ of the BSD socket layer (including System V variants).
The manifest constants used under 4.x BSD for protocol families
are PF_UNIX, PF_INET, and so on, while AF_UNIX, AF_INET, and so on
are used for address families. However, already the BSD man page
promises: "The protocol family generally is the same as the ad‐
dress family", and subsequent standards use AF_* everywhere.
+ SOCK_NONBLOCK
+ SOCK_CLOEXEC
+ POSIX.1‐2024.
+
EXAMPLES
An example of the use of socket() is shown in getaddrinfo(3).
SEE ALSO
See the WIP here:
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/log/?h=posix24>
Cheers,
Alex
> .BR socket ()
> appeared in 4.2BSD.
> It is generally portable to/from
> --
> 2.49.0
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread