public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sendfile.2: pull in_fd type requirements up to 6.7
@ 2023-12-21  1:31 наб
  2023-12-21 11:08 ` Alejandro Colomar
  0 siblings, 1 reply; 4+ messages in thread
From: наб @ 2023-12-21  1:31 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]

But this does mean that since 5.12 supports
(5.12 has ISREG|ISBLK, this actually matches 6.0 semantics):
  any      -> pipe  via splice
  seekable -> any

Also, there are many seekable files which aren't regular,
and the offset is updated regardless.
This is obvious, but the wording is clumsy.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man2/sendfile.2 | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/man2/sendfile.2 b/man2/sendfile.2
index 24de71072..a385949c1 100644
--- a/man2/sendfile.2
+++ b/man2/sendfile.2
@@ -91,12 +91,21 @@ .SH DESCRIPTION
 .BR mmap (2)-like
 operations
 (i.e., it cannot be a socket).
+Except since Linux 5.12
+.\" commit b964bf53e540262f2d12672b3cca10842c0172e7
+and if
+.I out_fd
+is a pipe, in which case
+.BR sendfile ()
+desugars to a
+.BR splice (2)
+and its restrictions apply.
 .P
 Before Linux 2.6.33,
 .I out_fd
 must refer to a socket.
 Since Linux 2.6.33 it can be any file.
-If it is a regular file, then
+If it's seekable, then
 .BR sendfile ()
 changes the file offset appropriately.
 .SH RETURN VALUE
-- 
2.39.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sendfile.2: pull in_fd type requirements up to 6.7
  2023-12-21  1:31 [PATCH] sendfile.2: pull in_fd type requirements up to 6.7 наб
@ 2023-12-21 11:08 ` Alejandro Colomar
  2023-12-21 13:29   ` наб
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2023-12-21 11:08 UTC (permalink / raw)
  To: наб; +Cc: Alejandro Colomar (man-pages), linux-man

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

Hey наб,

> Cc: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>

Please use <alx@kernel.org>; I'm deprecating my gmail account.

On Thu, Dec 21, 2023 at 02:31:35AM +0100, наб wrote:
> But this does mean that since 5.12 supports

Did you mean "since 5.12, _it_ supports"?

> (5.12 has ISREG|ISBLK, this actually matches 6.0 semantics):
>   any      -> pipe  via splice
>   seekable -> any
> 
> Also, there are many seekable files which aren't regular,
> and the offset is updated regardless.
> This is obvious, but the wording is clumsy.
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> ---
>  man2/sendfile.2 | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/man2/sendfile.2 b/man2/sendfile.2
> index 24de71072..a385949c1 100644
> --- a/man2/sendfile.2
> +++ b/man2/sendfile.2
> @@ -91,12 +91,21 @@ .SH DESCRIPTION
>  .BR mmap (2)-like
>  operations
>  (i.e., it cannot be a socket).
> +Except since Linux 5.12
> +.\" commit b964bf53e540262f2d12672b3cca10842c0172e7
> +and if
> +.I out_fd
> +is a pipe, in which case
> +.BR sendfile ()
> +desugars to a
> +.BR splice (2)
> +and its restrictions apply.
>  .P
>  Before Linux 2.6.33,
>  .I out_fd
>  must refer to a socket.
>  Since Linux 2.6.33 it can be any file.
> -If it is a regular file, then
> +If it's seekable, then
>  .BR sendfile ()
>  changes the file offset appropriately.
>  .SH RETURN VALUE
> -- 
> 2.39.2

LGTM.

Have a lovely day,
Alex

-- 
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sendfile.2: pull in_fd type requirements up to 6.7
  2023-12-21 11:08 ` Alejandro Colomar
@ 2023-12-21 13:29   ` наб
  2023-12-21 13:41     ` Alejandro Colomar
  0 siblings, 1 reply; 4+ messages in thread
From: наб @ 2023-12-21 13:29 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

On Thu, Dec 21, 2023 at 12:08:30PM +0100, Alejandro Colomar wrote:
> On Thu, Dec 21, 2023 at 02:31:35AM +0100, наб wrote:
> > But this does mean that since 5.12 supports
> Did you mean "since 5.12, _it_ supports"?
yes

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sendfile.2: pull in_fd type requirements up to 6.7
  2023-12-21 13:29   ` наб
@ 2023-12-21 13:41     ` Alejandro Colomar
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2023-12-21 13:41 UTC (permalink / raw)
  To: наб; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

On Thu, Dec 21, 2023 at 02:29:17PM +0100, наб wrote:
> On Thu, Dec 21, 2023 at 12:08:30PM +0100, Alejandro Colomar wrote:
> > On Thu, Dec 21, 2023 at 02:31:35AM +0100, наб wrote:
> > > But this does mean that since 5.12 supports
> > Did you mean "since 5.12, _it_ supports"?
> yes

Thanks!  Patch applied and amended.

Have a lovely day,
Alex

-- 
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-21 13:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21  1:31 [PATCH] sendfile.2: pull in_fd type requirements up to 6.7 наб
2023-12-21 11:08 ` Alejandro Colomar
2023-12-21 13:29   ` наб
2023-12-21 13:41     ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox