linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in sendfile

MFC after:		1 month
This commit is contained in:
Dmitry Chagin 2023-08-19 21:55:23 +03:00
parent da5a6738d5
commit 4f9fac78d4

View File

@ -2570,6 +2570,8 @@ linux_sendfile_common(struct thread *td, l_int out, l_int in,
else
error = sendfile_fallback(td, fp, out, offset, count,
&sbytes);
if (error == ENOBUFS && (ofp->f_flag & FNONBLOCK) != 0)
error = EAGAIN;
if (error == 0)
td->td_retval[0] = sbytes;
}