Files
AnyPS5/docs
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
..