diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 67736ecc69f6..834c2c938925 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -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; }