Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Aug 2023 18:56:17 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4f9fac78d4da - main - linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in sendfile
Message-ID:  <202308191856.37JIuH3B084234@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=4f9fac78d4da662d4ae29c4e1d71c66cd29fcfbb

commit 4f9fac78d4da662d4ae29c4e1d71c66cd29fcfbb
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-08-19 18:55:23 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-08-19 18:55:23 +0000

    linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in sendfile
    
    MFC after:              1 month
---
 sys/compat/linux/linux_socket.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308191856.37JIuH3B084234>