* [PATCH] sendfile.2: Fix description of the out_fd
@ 2011-01-27 8:48 Akira Fujita
[not found] ` <4D413168.1080901-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Akira Fujita @ 2011-01-27 8:48 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
Hi,
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>
---
man2/sendfile.2 | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff -Nrup man-pages-3.32-a/man2/sendfile.2 man-pages-3.32-b/man2/sendfile.2
--- 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-01-27 16:03:48.000000000 +0900
@@ -87,15 +87,11 @@ 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).
Applications may wish to fall back to
.BR read (2)/ write (2)
@@ -168,6 +164,9 @@ In Linux 2.4 and earlier,
could refer to a regular file, and
.BR sendfile ()
changed the current offset of that file.
+Since 2.6.33,
+.I out_fd
+can refer to any file.
The original Linux
.BR sendfile ()
--
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] 3+ messages in thread
* Re: [PATCH] sendfile.2: Fix description of the out_fd
[not found] ` <4D413168.1080901-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>
@ 2011-02-12 20:11 ` Przemysław Pawełczyk
[not found] ` <AANLkTimMgyM+bUmePtxL83PZdQfRFdZes-hmOLAARRvp-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Przemysław Pawełczyk @ 2011-02-12 20:11 UTC (permalink / raw)
To: Akira Fujita
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA
Hi,
2011/1/27 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.
And I thought I was the only one discovering it recently (beside a few
obvious people year ago). :)
> diff -Nrup man-pages-3.32-a/man2/sendfile.2 man-pages-3.32-b/man2/sendfile.2
> --- 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-01-27 16:03:48.000000000 +0900
> @@ -87,15 +87,11 @@ 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).
I don't think that completely removing out_fd socket restriction part
is a proper way of fixing this page. Such information should not be
lost.
I would add here sth like:
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 sendfile() changes its offset
appropriately.
>
> Applications may wish to fall back to
> .BR read (2)/ write (2)
> @@ -168,6 +164,9 @@ In Linux 2.4 and earlier,
> could refer to a regular file, and
s/could/could also/
> .BR sendfile ()
> changed the current offset of that file.
> +Since 2.6.33,
> +.I out_fd
> +can refer to any file.
IMO this change shouldn't be mentioned in NOTES section.
>
> The original Linux
> .BR sendfile ()
Regards.
--
Przemysław 'Przemoc' Pawełczyk
http://przemoc.net/
--
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] 3+ messages in thread
* Re: [PATCH] sendfile.2: Fix description of the out_fd
[not found] ` <AANLkTimMgyM+bUmePtxL83PZdQfRFdZes-hmOLAARRvp-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-02-14 10:11 ` Akira Fujita
0 siblings, 0 replies; 3+ messages in thread
From: Akira Fujita @ 2011-02-14 10:11 UTC (permalink / raw)
To: Przemysław Pawełczyk
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA
Hi Przemysław,
Thank you for comment :)
Would you review this patch again?
Regards,
Akira Fujita
---
--- 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-02-14 09:02:57.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.
(2011/02/13 5:11), Przemysław Pawełczyk wrote:
> Hi,
>
> 2011/1/27 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.
>
> And I thought I was the only one discovering it recently (beside a few
> obvious people year ago). :)
>
>> diff -Nrup man-pages-3.32-a/man2/sendfile.2 man-pages-3.32-b/man2/sendfile.2
>> --- 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-01-27 16:03:48.000000000 +0900
>> @@ -87,15 +87,11 @@ 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).
>
> I don't think that completely removing out_fd socket restriction part
> is a proper way of fixing this page. Such information should not be
> lost.
> I would add here sth like:
>
> 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 sendfile() changes its offset
> appropriately.
>
>>
>> Applications may wish to fall back to
>> .BR read (2)/ write (2)
>> @@ -168,6 +164,9 @@ In Linux 2.4 and earlier,
>> could refer to a regular file, and
>
> s/could/could also/
>
>> .BR sendfile ()
>> changed the current offset of that file.
>
>> +Since 2.6.33,
>> +.I out_fd
>> +can refer to any file.
>
> IMO this change shouldn't be mentioned in NOTES section.
>
>>
>> The original Linux
>> .BR sendfile ()
>
> Regards.
>
--
Akira Fujita <a-fujita-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>
The First Fundamental Software Development Group,
Software Development Division,
NEC Software Tohoku, Ltd.
--
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] 3+ messages in thread
end of thread, other threads:[~2011-02-14 10:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 8:48 [PATCH] sendfile.2: Fix description of the out_fd Akira Fujita
[not found] ` <4D413168.1080901-cUW4a6blu5N8UrSeD/g0lQ@public.gmane.org>
2011-02-12 20:11 ` Przemysław Pawełczyk
[not found] ` <AANLkTimMgyM+bUmePtxL83PZdQfRFdZes-hmOLAARRvp-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-14 10:11 ` Akira Fujita
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.