• Shawn Walker-Salas's avatar
    net: broken sendfile on SmartOS/Solaris · 98080a6c
    Shawn Walker-Salas authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    98080a6c
sendfile_solaris.go 2.72 KB