Skip to content

Commit

Permalink
linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets i…
Browse files Browse the repository at this point in the history
…n sendfile

MFC after:		1 month
  • Loading branch information
lemul committed Aug 19, 2023
1 parent da5a673 commit 4f9fac7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sys/compat/linux/linux_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4f9fac7

Please sign in to comment.