This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients giampaolo.rodola, loewis, pitrou, rosslagerwall
Date 2011-01-11.11:39:45
SpamBayes Score 2.505213e-08
Marked as misclassified No
Message-id <1294745990.88.0.206244876499.issue10882@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for writing this.
Follows my comments.

I would focus on trying to provide a unique interface across all platforms. Being sendfile() not a standard POSIX I think we should not worry about providing a strict one-to-one interface.

"headers" and "trailers" arguments should be available everywhere as they are crucial in different protocols such as HTTP.
On Linux this is possible by using the TCP_CORK option.
"man sendfile" on Linux provides some information. Also you might find useful to see how medusa did this (/medusa-20010416/sendfile/sendfilemodule.c):
http://www.nightmare.com/medusa/

The "offset" parameter should be available everywhere, Linux included (in your patch you dropped Linux support).
Also, I think it should be optional since when it's NULL, sendfile() implicitly assumes the current offset (file's tell() return value).
This is true on Linux, at least. Not sure about other platforms but my best guess is that it should not be mandatory.

It turns out the only peculiar argument is "flags", available only on *BSD.
I'm not sure what's best to do here. Maybe it makes sense to provide it across all platforms, defaulting to 0 and raise ValueError when specified on systems != *BSD.
In summary, the function might look like this:

sendfile(out, in, count, offset=None, headers=None, trailers=None, flags=0)
History
Date User Action Args
2011-01-11 11:39:50giampaolo.rodolasetrecipients: + giampaolo.rodola, loewis, pitrou, rosslagerwall
2011-01-11 11:39:50giampaolo.rodolasetmessageid: <1294745990.88.0.206244876499.issue10882@psf.upfronthosting.co.za>
2011-01-11 11:39:45giampaolo.rodolalinkissue10882 messages
2011-01-11 11:39:45giampaolo.rodolacreate