mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Handle ENOSPC with a partial write.
Similar to the EPIPE case, we can return the number of bytes written before ENOSPC was encountered. If the app tries to write more, we can return ENOSPC on the next write. PiperOrigin-RevId: 263041648
This commit is contained in:
committed by
gVisor bot
parent
691c2f8173
commit
9769a8eaa4
@@ -91,6 +91,10 @@ func handleIOError(t *kernel.Task, partialResult bool, err, intr error, op strin
|
||||
// TODO(gvisor.dev/issue/161): In some cases SIGPIPE should
|
||||
// also be sent to the application.
|
||||
return nil
|
||||
case syserror.ENOSPC:
|
||||
// Similar to EPIPE. Return what we wrote this time, and let
|
||||
// ENOSPC be returned on the next call.
|
||||
return nil
|
||||
case syserror.ECONNRESET:
|
||||
// For TCP sendfile connections, we may have a reset. But we
|
||||
// should just return n as the result.
|
||||
|
||||
Reference in New Issue
Block a user