Author giampaolo.rodola
Recipients giampaolo.rodola, loewis, pitrou, rosslagerwall
Date 2011-01-11.11:39:45
SpamBayes Score 2.50521e-08
Marked as misclassified No
Message-id <>
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):

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)
Date User Action Args
2011-01-11 11:39:50giampaolo.rodolasetrecipients: + giampaolo.rodola, loewis, pitrou, rosslagerwall
2011-01-11 11:39:50giampaolo.rodolasetmessageid: <>
2011-01-11 11:39:45giampaolo.rodolalinkissue10882 messages
2011-01-11 11:39:45giampaolo.rodolacreate