Commit Graph
5 Commits
Author SHA1 Message Date
Retr0 7a0bbc4897 Merge remote-tracking branch 'origin/main' into fix/sendfile-nonregular-einval
# Conflicts:
#	core/libs/tests/GuestSendfile.cpp
2026-10-25 02:47:13 +03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Retr0 68db53d7a5 fix(libkernel): fail sendfile with EINVAL for a file that is not a regular file 2026-10-24 02:44:14 +03:00
Retr0 9bd2bb06cc fix(libkernel): return ENOTSOCK from sendfile on a descriptor that is not a socket
FreeBSD 11 sendfile checks the file descriptor first, then looks up the
socket with getsock_cap, which answers ENOTSOCK for an open descriptor
that is not a socket and EBADF for one that is not open
(sys/kern/kern_sendfile.c, sys/kern/uipc_syscalls.c).

sendfile replaced the errno that Lookup had already set with EBADF. It
now reports the errno Lookup chose, so an open non-socket gives ENOTSOCK
and a closed descriptor still gives EBADF. The sentence about this gap
is cut from the sendfile debt entry and guest_sendfile covers both cases.
2026-10-21 15:16:35 +03:00
DariusHQ bad19037a6 feat(libkernel): implement sendfile
PS5MC (PPSA99420) stops at start-up on sendfile. It follows FreeBSD 11:
headers, the file range and trailers go to a connected stream socket, the
file offset does not move, a non-blocking socket fails with EAGAIN after
a partial send, and *sbytes reports what was sent. The checks and the
point where *sbytes is written follow kern_sendfile.c.
2026-10-11 16:19:13 +03:00