Author giampaolo.rodola
Recipients anacrolix, giampaolo.rodola, loewis, pitrou, rosslagerwall
Date 2011-01-25.11:47:50
SpamBayes Score 6.86938e-06
Marked as misclassified No
Message-id <1295956072.01.0.999224765517.issue10882@psf.upfronthosting.co.za>
In-reply-to
Content
Please note that on FreeBSD things work a little bit differently for non-blocking sockets:
http://www.freebsd.org/cgi/man.cgi?query=sendfile&sektion=2

In details I'm talking about:

> When using a socket marked for non-blocking I/O, sendfile() may send
> fewer bytes than requested.  In this case, the number of bytes 
> success-fully written is returned in *sbytes (if specified), and the 
> error EAGAIN is returned.

...and the similar note about EBUSY, later in the page.
Something like this should work:


ret = sendfile(in, out, offset, &sbytes, &sf, flags);

...

if (ret == -1) {
    if ((errno == EAGAIN) || (errno == EBUSY)) {
        return Py_BuildValue("ll", sbytes, offset + sbytes);
    } 
    return posix_error();
}
History
Date User Action Args
2011-01-25 11:47:52giampaolo.rodolasetrecipients: + giampaolo.rodola, loewis, pitrou, anacrolix, rosslagerwall
2011-01-25 11:47:52giampaolo.rodolasetmessageid: <1295956072.01.0.999224765517.issue10882@psf.upfronthosting.co.za>
2011-01-25 11:47:50giampaolo.rodolalinkissue10882 messages
2011-01-25 11:47:50giampaolo.rodolacreate