]> Cypherpunks repositories - gostls13.git/commit
net: broken sendfile on SmartOS/Solaris
authorShawn Walker-Salas <shawn.walker@oracle.com>
Fri, 8 Apr 2016 22:59:04 +0000 (15:59 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 12 Apr 2016 19:00:46 +0000 (19:00 +0000)
commit98080a6c64c2d9bc2a759b66a9b861af4ef7367b
treebf486e483620060bd181d7280ef81cc437592842
parentb1851a3c11a179d4eb55f9d0dd25ef81668a9f81
net: broken sendfile on SmartOS/Solaris

In the event of a partial write on Solaris and some BSDs, the offset
pointer passed to sendfile() will be updated even though the function
returns -1 if errno is set to EAGAIN/EINTR.  In that case, calculate the
bytes written based on the difference between the updated offset and the
original offset.  If no bytes were written, and errno is set to
EAGAIN/EINTR, ignore the errno.

Fixes #13892

Change-Id: I6334b5ef2edcbebdaa7db36fa4f7785967313c2d
Reviewed-on: https://go-review.googlesource.com/21769
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/sendfile_solaris.go
src/net/sendfile_test.go [new file with mode: 0644]