Commit Graph

5 Commits

Author SHA1 Message Date
Niko 5731e02841 fix(libkernel): close guest sockets in sceKernelClose
sceKernelClose passed every descriptor to the host close. Guest socket
descriptors start at 0x10000000 and are not host descriptors, so closing
an open socket returned SCE_KERNEL_ERROR_EBADF and left it in the guest
socket table with its host socket open. Route them to GuestSockets::Close
as close, sceKernelRead and sceKernelWrite already do; a closed socket
still returns SCE_KERNEL_ERROR_EBADF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:11:53 +02:00
MarcZX100 bb9bd2183c fix(libkernel): return ESPIPE for positioned socket I/O 2026-10-11 09:36:43 +02:00
MarcZX100 eb9efe109e fix(libkernel): preserve vector socket error codes 2026-10-11 01:17:37 +00:00
MarcZX100 d78af2c710 fix(libkernel): route vector I/O on guest sockets 2026-10-11 01:16:58 +00:00
Jan Šlégl 9d0b105771 fix(libkernel): read and write guest sockets
read, write, _read and _write on a guest socket descriptor went to the
host, which has no such descriptor, so sceKernelRead and sceKernelWrite
threw. They now reach the socket as recv and send without flags, with
the socket layer's errno (EAGAIN 35, EPIPE 32, EBADF 9), a zero-length
read returns 0 as dofileread does, and the two sceKernel forms return
the kernel error for the same cases. The host's SIGPIPE on EPIPE, a
write above INT_MAX bytes, readv, writev and the positioned forms are
recorded in TechnicalDebt.

OpenSSL's QUIC notifier signals its socketpair with write and read.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-09 23:57:33 +02:00