* [RESEND][PATCH] sendfile.2: Fix description of the out_fd
@ 2011-03-09 5:58 Akira Fujita
[not found] ` <4D771705.1020408-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Akira Fujita @ 2011-03-09 5:58 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
commit cc56f7de7f00d188c7c4da1e9861581853b9e92f made
sendfile(2) can work with any output file.
Therefore the out_fd of sendfile(2) can refer to any file,
but current manual (man-pages-3.32) has not been changed so far.
Signed-off-by: Akira Fujita <a-fujita-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>
---
sendfile.2 | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
--- man-pages-3.32-a/man2/sendfile.2 2010-12-03 16:01:59.000000000 +0900
+++ man-pages-3.32-b/man2/sendfile.2 2011-03-09 10:34:53.000000000 +0900
@@ -87,15 +87,17 @@ and the file offset will be updated by t
.I count
is the number of bytes to copy between the file descriptors.
-Presently (Linux 2.6.9):
-.IR in_fd ,
+.IR in_fd
must correspond to a file which supports
.BR mmap (2)-like
operations
-(i.e., it cannot be a socket);
-and
-.I out_fd
-must refer to a socket.
+(i.e., it cannot be a socket).
+
+.IR out_fd
+was required to be a socket, but since Linux 2.6.33 it can be
+any file. If it is a regular file, then
+.BR sendfile()
+changes its offset appropriately.
Applications may wish to fall back to
.BR read (2)/ write (2)
@@ -165,7 +167,7 @@ to minimize the number of packets and to
In Linux 2.4 and earlier,
.I out_fd
-could refer to a regular file, and
+could also refer to a regular file, and
.BR sendfile ()
changed the current offset of that file.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <4D771705.1020408-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>]
* Re: [RESEND][PATCH] sendfile.2: Fix description of the out_fd [not found] ` <4D771705.1020408-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org> @ 2011-09-11 16:00 ` Michael Kerrisk [not found] ` <CAKgNAkiSkgjEKDwk6R6RPhGDfJayXZGnxrfRVFcQ9t7K_S3eZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Michael Kerrisk @ 2011-09-11 16:00 UTC (permalink / raw) To: Akira Fujita; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA Hello Akira, 2011/3/9 Akira Fujita <a-fujita-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>: > commit cc56f7de7f00d188c7c4da1e9861581853b9e92f made > sendfile(2) can work with any output file. > Therefore the out_fd of sendfile(2) can refer to any file, > but current manual (man-pages-3.32) has not been changed so far. Thank you for this report! Some notes below. > Signed-off-by: Akira Fujita <a-fujita-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org> > --- > sendfile.2 | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > --- man-pages-3.32-a/man2/sendfile.2 2010-12-03 16:01:59.000000000 +0900 > +++ man-pages-3.32-b/man2/sendfile.2 2011-03-09 10:34:53.000000000 +0900 > @@ -87,15 +87,17 @@ and the file offset will be updated by t > .I count > is the number of bytes to copy between the file descriptors. > > -Presently (Linux 2.6.9): > -.IR in_fd , > +.IR in_fd > must correspond to a file which supports > .BR mmap (2)-like > operations > -(i.e., it cannot be a socket); You removed that piece, but I believe nothing changed for 'in_fd', so I kept that piece. > -and > -.I out_fd > -must refer to a socket. > +(i.e., it cannot be a socket). > + > +.IR out_fd > +was required to be a socket, but since Linux 2.6.33 it can be > +any file. If it is a regular file, then > +.BR sendfile() > +changes its offset appropriately. > > Applications may wish to fall back to > .BR read (2)/ write (2) > @@ -165,7 +167,7 @@ to minimize the number of packets and to > > In Linux 2.4 and earlier, > .I out_fd > -could refer to a regular file, and > +could also refer to a regular file, and > .BR sendfile () > changed the current offset of that file. For 3.33 I applied a slightly modified version of you patch; see below. Cheers, Michael --- a/man2/sendfile.2 +++ b/man2/sendfile.2 @@ -92,10 +92,14 @@ The argument must correspond to a file which supports .BR mmap (2)-like operations -(i.e., it cannot be a socket); -and +(i.e., it cannot be a socket). +In Linux kernels before 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 +.BR sendfile() +changes the file offset offset appropriately. Applications may wish to fall back to .BR read (2)/ write (2) @@ -165,7 +169,7 @@ to minimize the number of packets and to tune performance. In Linux 2.4 and earlier, .I out_fd -could refer to a regular file, and +could also refer to a regular file, and .BR sendfile () changed the current offset of that file. -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CAKgNAkiSkgjEKDwk6R6RPhGDfJayXZGnxrfRVFcQ9t7K_S3eZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [RESEND][PATCH] sendfile.2: Fix description of the out_fd [not found] ` <CAKgNAkiSkgjEKDwk6R6RPhGDfJayXZGnxrfRVFcQ9t7K_S3eZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-09-15 23:21 ` Akira Fujita 2011-09-16 6:24 ` Stefan Puiu 1 sibling, 0 replies; 5+ messages in thread From: Akira Fujita @ 2011-09-15 23:21 UTC (permalink / raw) To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA Hello Michael, Thank you for your work! Regards, Akira Fujita (2011/09/12 1:00), Michael Kerrisk wrote: > Hello Akira, > > 2011/3/9 Akira Fujita<a-fujita-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>: >> commit cc56f7de7f00d188c7c4da1e9861581853b9e92f made >> sendfile(2) can work with any output file. >> Therefore the out_fd of sendfile(2) can refer to any file, >> but current manual (man-pages-3.32) has not been changed so far. > > Thank you for this report! Some notes below. > >> Signed-off-by: Akira Fujita<a-fujita-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org> >> --- >> sendfile.2 | 16 +++++++++------- >> 1 file changed, 9 insertions(+), 7 deletions(-) >> --- man-pages-3.32-a/man2/sendfile.2 2010-12-03 16:01:59.000000000 +0900 >> +++ man-pages-3.32-b/man2/sendfile.2 2011-03-09 10:34:53.000000000 +0900 >> @@ -87,15 +87,17 @@ and the file offset will be updated by t >> .I count >> is the number of bytes to copy between the file descriptors. >> >> -Presently (Linux 2.6.9): >> -.IR in_fd , >> +.IR in_fd >> must correspond to a file which supports >> .BR mmap (2)-like >> operations >> -(i.e., it cannot be a socket); > > You removed that piece, but I believe nothing changed for 'in_fd', so > I kept that piece. > >> -and >> -.I out_fd >> -must refer to a socket. >> +(i.e., it cannot be a socket). >> + >> +.IR out_fd >> +was required to be a socket, but since Linux 2.6.33 it can be >> +any file. If it is a regular file, then >> +.BR sendfile() >> +changes its offset appropriately. >> >> Applications may wish to fall back to >> .BR read (2)/ write (2) >> @@ -165,7 +167,7 @@ to minimize the number of packets and to >> >> In Linux 2.4 and earlier, >> .I out_fd >> -could refer to a regular file, and >> +could also refer to a regular file, and >> .BR sendfile () >> changed the current offset of that file. > > For 3.33 I applied a slightly modified version of you patch; see below. > > Cheers, > > Michael > > --- a/man2/sendfile.2 > +++ b/man2/sendfile.2 > @@ -92,10 +92,14 @@ The > argument must correspond to a file which supports > .BR mmap (2)-like > operations > -(i.e., it cannot be a socket); > -and > +(i.e., it cannot be a socket). > +In Linux kernels before 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 > +.BR sendfile() > +changes the file offset offset appropriately. > > Applications may wish to fall back to > .BR read (2)/ write (2) > @@ -165,7 +169,7 @@ to minimize the number of packets and to tune performance. > > In Linux 2.4 and earlier, > .I out_fd > -could refer to a regular file, and > +could also refer to a regular file, and > .BR sendfile () > changed the current offset of that file. > > -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RESEND][PATCH] sendfile.2: Fix description of the out_fd [not found] ` <CAKgNAkiSkgjEKDwk6R6RPhGDfJayXZGnxrfRVFcQ9t7K_S3eZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2011-09-15 23:21 ` Akira Fujita @ 2011-09-16 6:24 ` Stefan Puiu [not found] ` <CACKs7VDNboqj7XFSkwfzBMazzhSbGGTjt6+M642CgLk5UofXVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 1 sibling, 1 reply; 5+ messages in thread From: Stefan Puiu @ 2011-09-16 6:24 UTC (permalink / raw) To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w Cc: Akira Fujita, linux-man-u79uwXL29TY76Z2rM5mHXA HI, On Sun, Sep 11, 2011 at 7:00 PM, Michael Kerrisk <mtk.manpages-Re5JQEeQqe8@public.gmane.orgm> wrote: [...] > > For 3.33 I applied a slightly modified version of you patch; see below. > > Cheers, > > Michael > > --- a/man2/sendfile.2 > +++ b/man2/sendfile.2 > @@ -92,10 +92,14 @@ The > argument must correspond to a file which supports > .BR mmap (2)-like > operations > -(i.e., it cannot be a socket); > -and > +(i.e., it cannot be a socket). > +In Linux kernels before 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 > +.BR sendfile() > +changes the file offset offset appropriately. You wrote 'offset' twice here, I guess it's a typo, unless I'm missing something... Thanks, Stefan. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CACKs7VDNboqj7XFSkwfzBMazzhSbGGTjt6+M642CgLk5UofXVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [RESEND][PATCH] sendfile.2: Fix description of the out_fd [not found] ` <CACKs7VDNboqj7XFSkwfzBMazzhSbGGTjt6+M642CgLk5UofXVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-09-17 5:09 ` Michael Kerrisk 0 siblings, 0 replies; 5+ messages in thread From: Michael Kerrisk @ 2011-09-17 5:09 UTC (permalink / raw) To: Stefan Puiu; +Cc: Akira Fujita, linux-man-u79uwXL29TY76Z2rM5mHXA On Fri, Sep 16, 2011 at 8:24 AM, Stefan Puiu <stefan.puiu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > HI, > > On Sun, Sep 11, 2011 at 7:00 PM, Michael Kerrisk <mtk.manpages@gmail.com> wrote: > [...] >> >> For 3.33 I applied a slightly modified version of you patch; see below. >> >> Cheers, >> >> Michael >> >> --- a/man2/sendfile.2 >> +++ b/man2/sendfile.2 >> @@ -92,10 +92,14 @@ The >> argument must correspond to a file which supports >> .BR mmap (2)-like >> operations >> -(i.e., it cannot be a socket); >> -and >> +(i.e., it cannot be a socket). >> +In Linux kernels before 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 >> +.BR sendfile() >> +changes the file offset offset appropriately. > > You wrote 'offset' twice here, I guess it's a typo, unless I'm missing > something... Thanks Stefan. Fixed now. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-09-17 5:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 5:58 [RESEND][PATCH] sendfile.2: Fix description of the out_fd Akira Fujita
[not found] ` <4D771705.1020408-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>
2011-09-11 16:00 ` Michael Kerrisk
[not found] ` <CAKgNAkiSkgjEKDwk6R6RPhGDfJayXZGnxrfRVFcQ9t7K_S3eZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-15 23:21 ` Akira Fujita
2011-09-16 6:24 ` Stefan Puiu
[not found] ` <CACKs7VDNboqj7XFSkwfzBMazzhSbGGTjt6+M642CgLk5UofXVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-17 5:09 ` Michael Kerrisk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox