Repository navigation
fix(libkernel): poll libSceNet sockets with the host wait - #4933
Conversation
|
Windows test of this PR. Environment: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, Result: guest_dup and guest_fstatfs (2 of 2) pass. Not checked: whether the test fails without the change in the library code; the PR was not tested alone, only in the combined merge; no title run; Linux not tested. AI-assisted (Claude Code). |
bc299f2 to
47dc519
Compare
|
Title evidence for this PR: ProsperoLight (PPSA99002, catalog release) on Windows 11, MinGW GCC 15.2.0, Release, with the original
AI-assisted (Claude Code). |
|
Tested on Windows with a second title: OpenNOW PS5 0.1 (PPSA99082, catalog release, On Descriptor 7 is the title's non-blocking TCP socket made through libSceNet (its log: With #4924 and this PR cherry-picked onto So this also unblocks PPSA99082 on Windows. One note for whoever merges second: #4924 and #4988 conflict in AI-assisted: yes (Claude Code); the runs are from my machine. |
|
Windows 11 Pro, Intel Core i9-14900K, 128 GB, NVIDIA GeForce RTX 5080 (driver 32.0.16.1714), WinLibs GCC 15.2.0, Release, Tests
ProsperoLight, 60 s runs
The head's main screen at 57 s: The branch no longer merges cleanly into Verdict: works on Windows. The ProsperoLight stop is gone, and the new test fails without the library change. |
|
Another title that stops here: OpenNOW PS5 Prototype (PPSA99082, catalog release), on Windows 11, MinGW GCC 15, Release. It doesn't reach this idle. With menu input (Enter/arrow key presses sent to its window), it opens A local log at that throw showed With this PR merged onto the same AI-assisted: yes (Claude Code) |
With libSceNet sockets on ordinary descriptor numbers (#4391), poll on a libSceNet socket threw "neither a socket nor a pipe": poll only knew libkernel sockets and pipes, while select already asks libSceNet through its poller. libSceNet now lends libkernel the host socket behind a descriptor, together with an owner that keeps it open, so poll puts it in the same WSAPoll or poll call as libkernel sockets. ProsperoLight (PPSA99002) stopped here on Linux and now reaches its PC list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EvDbpwUPTa78oCAJqe7m9K
47dc519 to
62d8eea
Compare
|
Rebased onto current |

What
Follow-up to #4924 (and #4391). With libSceNet sockets on ordinary descriptor numbers,
pollon a libSceNet socket throws:pollonly knew libkernel sockets and pipes.selectalready handles libSceNet sockets through the poller libSceNet registers, butpollnever asked it.libSceNet now registers a native lookup with libkernel (
KernelSetSocketNativeLookup_nid_no_patch), next to its poller, closer, option setter and status control. For a libSceNet descriptor it returns the host socket plus ashared_ptrowner that keeps that socket open.polluses it whenFindmisses, and puts the host socket into the sameWSAPoll/pollcall as libkernel sockets, with the same flag mapping and the same WindowsPOLLPRIrule. So mixed sets (libkernel sockets, libSceNet sockets, pipes) need no second wait loop, and a concurrentsceNetSocketClosecannot close the host socket under the wait.This branch contains #4391's and #4924's commits; the change here is the last commit (bc299f2).
Tested
Linux (Arch, GCC 16.2.1, Release), on #4924's head plus this commit:
guest_sce_net: new checks thatpollon a libSceNet UDP socket reports nothing, thenPOLLINafter a datagram arrives, and that a set with one libkernel and one libSceNet socket reportsPOLLOUTon both. Without theUdp.cppchange it aborts withpoll: descriptor 7 is neither a socket nor a pipe.ctest: 1002 of 1002 pass (the 8 display-only VideoOut and AGC tests skip).--to-intel), 3 runs of 60 s: no stop. On fix(libkernel): answer fcntl status flags on libSceNet sockets #4924 alone it aborted on thepollabove. It now reaches its main screen ("Your PCs", "No PCs yet", Sunshine discovery running).tools/check_conventions.py --base upstream/mainpasses.POLLPRIlines inpoll; whichever lands second needs a small rebase.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)