[issue36488] BSD/OSX: os.sendfile() does not return bytes sent on EINTR

2019-03-30 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
nosy: +rosslagerwall

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36488] BSD/OSX: os.sendfile() does not return bytes sent on EINTR

2019-03-30 Thread Giampaolo Rodola'


New submission from Giampaolo Rodola' :

>From "man sendfile" on both OSX and FreeBSD:

<<[EINTR] A signal interrupted sendfile() before it could be completed. If 
specified, the number of bytes successfully sent will be returned in *len.>>

Right now we catch EINTR and simply retry. Instead we should only retry is no 
bytes were sent, else we should return those bytes, similarly to what we do on 
EAGAIN and EBUSY:
https://github.com/python/cpython/blob/2438cdf0e932a341c7613bf4323d06b91ae9f1f1/Modules/posixmodule.c#L8907-L8917

--
components: Library (Lib)
messages: 339214
nosy: giampaolo.rodola
priority: normal
severity: normal
stage: needs patch
status: open
title: BSD/OSX: os.sendfile() does not return bytes sent on EINTR
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com