Bug 86001 - Errors in sendfile man page
Summary: Errors in sendfile man page
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-10 21:38 UTC by Askar Safin
Modified: 2016-03-11 08:55 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Askar Safin 2014-10-10 21:38:57 UTC
Current "man sendfile" (git commit 36ad6ae0b4b6252a921a91dbd785de8fd88a364b) from kernel man pages contradicts to itself. The section "DESCRIPTION" says: "In Linux kernels before 2.6.33, out_fd must refer to a socket. Since Linux 2.6.33 it can be any file", and AFAIK this is right current info. But the section "NOTES" says: "In Linux 2.4 and earlier, out_fd could also refer to a regular file" and this confuses. Also, the "NOTES" says: "The Linux-specific splice(2) call supports transferring data between arbitrary files (e.g., a pair of sockets)". This is wrong, because one splice call cannot splice together two sockets. So, please fix the man. Probably you should double-check whole man and make sure that whole man is up-to-date
Comment 1 Michael Kerrisk 2015-05-05 09:06:11 UTC
I changed the text in NOTES to

[[
In Linux 2.4 and earlier,
.I out_fd
could also refer to a regular file;
this possibility went away in the Linux 2.6.x kernel series,
but was restored in Linux 2.6.33.
]]

Thanks,

Michael
Comment 2 Askar Safin 2015-05-05 10:41:42 UTC
"The Linux-specific splice(2) call supports transferring data between arbitrary files (e.g., a pair of sockets)"

"pair of sockets" part is wrong. See splice(2). Also, I just tested this, splice doesn't work on pair of sockets (tested on Linux 3.16). So, please, change this phrase to (for example):

"The Linux-specific splice(2) call supports transferring data between arbitrary file descriptors provided one of them (or both) is a pipe".

(Also, where is your change? I don't see it in current head [ https://git.kernel.org/cgit/docs/man-pages/man-pages.git/tree/man2/sendfile.2?id=beb9356fdc3d377f27eec6fd2cb07b97bb1927d4 ])
Comment 3 Michael Kerrisk 2016-03-10 18:39:16 UTC
(In reply to Askar Safin from comment #2)
> "The Linux-specific splice(2) call supports transferring data between
> arbitrary files (e.g., a pair of sockets)"
> 
> "pair of sockets" part is wrong. See splice(2). Also, I just tested this,
> splice doesn't work on pair of sockets (tested on Linux 3.16). So, please,
> change this phrase to (for example):
> 
> "The Linux-specific splice(2) call supports transferring data between
> arbitrary file descriptors provided one of them (or both) is a pipe".

Thanks, Askar.

Changed as you suggest (but not yet pushed).

Cheers,

Michael
Comment 4 Askar Safin 2016-03-11 08:55:14 UTC
Thanks :)

Note You need to log in before you can comment on or make changes to this bug.