mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-30 12:25:49 +00:00
Human Fall Flat (PPSA02429) opens its sockets with libkernel's socket() and registers them with sceNetEpollControl. libSceNet only looked in its own socket table, so every ADD and DEL failed with SCE_NET_ERROR_EBADF. The game retries without pause: on box 2 it made more than 1.6 million failing calls on 14 descriptors in its first seconds, all of them libkernel sockets. sceNetEpollControl now accepts a descriptor libkernel has open as a socket, as sceNetSocketClose and sceNetSetsockopt already do for MXGP 26 (PPSA30839). sceNetEpollWait looks up the host socket of such a registration through libkernel after g_mutex is released, because that lookup asks libSceNet's own table for descriptors libkernel does not own, and keeps the owner alive across the host poll. libkernel's close() retires the registrations of the closed socket; a wait drops a registration whose socket is gone. guest_sce_net registers a libkernel UDP socket, waits for it to become readable and then writable, deletes it twice, closes registered sockets through close() and sceKernelClose and waits again, and checks that a descriptor that was never open still fails with EBADF.