fix(libkernel): select on kqueues as kqueue_poll answers #7248
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7248"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by HQasper on 2026-10-17T19:28:24Z.
What
Stacked on #7139: its four commits are included unchanged, and only the last commit (
fix(libkernel): select on kqueues as kqueue_poll answers) is new here. With #7139,selectstill reachedNotImplemented_nid_no_patchon Windows for a kqueue and for a descriptor that stopped being a socket or a pipe during the wait. On Linux, a kqueue's/dev/nullplaceholder was reported readable and writable.kqueue_pollanswers. This holds on both hosts and uses the newKernelEqueuePrivate::HasTriggeredEventsandKqueueReadable. Kqueues get their own poll group next to the guest sockets.EBADF;selectstarts over with the rest of the timeout, askern_selectlooks every descriptor up again in each pass.std::runtime_errornaming the descriptor whenselectstarts, before it waits. This is whatpolldoes in the same case.select_nid_postfixno longer reachesNotImplemented_nid_no_patch.tools/progress.py --compareofmain(55f82fee8) against this branch: +1 implemented (libkernelselect_nid_postfix), 3365 → 3366 of 3753 (89.66 % → 89.69 %).docs/dev/debt/libkernel.md: the twoselectentries describe the above, including the one window where it is not exact. A close that has removed the descriptor from the kqueue, pipe or file tables but not yet closed the host descriptor is seen as an unknown kind: it throws on Windows and is polled through the host on Linux.Overlaps: #5999 also changes
selecton Windows, but only for regular files (the part #7139 covers), and keeps theNotImplementedpath. This PR touches neither.Tested
Windows 11 Pro 26300, MinGW-w64 (WinLibs) Release build of this branch on
main55f82fee8. These pass:guest_select,guest_select_wait,guest_kqueue,guest_equeue_events,guest_pollandguest_socket_descriptors. The new kqueue cases inguest_select:EVFILT_USERevent is added withEV_CLEAR;selectwaits for up to 1 s,selectreturns 1 with only the read set;kevent, the kqueue is not ready again.Without the
Socket.cppchange they fail (selecton the kqueue ends inNotImplemented, exit0xc0000409).Full
ctest -j 24on the same build: 1421 of 1422 pass. The one failure,agc_driver_pixel_lds, is unrelated: it loses the device on this RTX 5090 (NVIDIA 617.42) on plainmain55f82fee8too.Linux not tested.
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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T20:34:15Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/Socket/src/Socket.cppcore/libs/tests/GuestSelect.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSelect.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/Equeue/Equeue.cppcore/libs/prx/libkernel/Socket/src/Socket.cppcore/libs/prx/libkernel/Equeue/Equeue.cppcore/libs/prx/libkernel/Equeue/Equeue.hppcore/libs/prx/libkernel/Equeue/src/Kqueue.cppdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/Equeue/Equeue.cppcore/libs/prx/libkernel/Equeue/src/Kqueue.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/Equeue/src/Kqueue.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/Equeue/Equeue.hppcore/libs/prx/libkernel/Equeue/src/Kqueue.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/Equeue/Equeue.hppcore/libs/prx/libkernel/Equeue/src/Kqueue.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/Equeue/Equeue.cppcore/libs/prx/libkernel/Equeue/Equeue.hppcore/libs/prx/libkernel/Equeue/src/Kqueue.cppdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.md