fix(libkernel): answer select on non-socket descriptors #3455

Merged
YossiYad merged 3 commits from upstream-pr/3455 into main 2026-10-11 11:49:06 +00:00
YossiYad commented 2026-10-11 10:56:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-11T10:56:41Z.


What

Carries the three commits of Silverash-i8/AnyPS5-fork:fix/select-non-socket-descriptors (author Abdulrahman Elkordy, issue #2811) unchanged apart from a clean rebase onto current main:

  • /dev/random and /dev/urandom descriptors are reported readable and writable in select, as FreeBSD reports a seeded random device.
  • Descriptor 0 is never reported readable and descriptors 1 and 2 are always writable, as for a console title with no input. Recorded in TechnicalDebt next to the existing entry on descriptors 0 to 2.
  • Any other descriptor that is not a libSceNet socket still throws, now naming the descriptor (or saying libSceNet is not loaded).

Titles behind it, from #2811: Minecraft Dungeons (PPSA16064) stopped on select on descriptor 0 and reaches the menu with this change (MisterbALLIN's run); RIDE 4 (PPSA01599) stopped on the same line after OpenSSL opened /dev/urandom and gets past it (alfalfa-star's run). The author is under the impression the intake limit stops them from opening this themselves, so I am carrying it with the commits as they are.

Closes #2811.

Tested

Linux (Fedora, GCC 16.2.1, Ninja, Release, -DBUILD_TESTING=ON), based on current main 03a84d02:

  • Full build and ctest: 826 of 827 pass. The one failure, agc_driver_pixel_interlock, is a GPU fragment-shader-interlock race test unrelated to this change (it touches only Socket.cpp); it is flaky on this RADV driver and passes on rerun (2 of 3). All guest_, kernel and net tests pass..
  • tools/check_conventions.py --base upstream/main and git diff --check pass.
  • The author reported guest_sce_net with the new random-device and standard-descriptor cases passing on Windows 11, WinLibs GCC 15.2.0 r7. No title was run on this machine.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4818544583 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3455). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-11T10:56:41Z. --- ### What Carries the three commits of `Silverash-i8/AnyPS5-fork:fix/select-non-socket-descriptors` (author Abdulrahman Elkordy, issue #2811) unchanged apart from a clean rebase onto current `main`: - `/dev/random` and `/dev/urandom` descriptors are reported readable and writable in `select`, as FreeBSD reports a seeded random device. - Descriptor 0 is never reported readable and descriptors 1 and 2 are always writable, as for a console title with no input. Recorded in TechnicalDebt next to the existing entry on descriptors 0 to 2. - Any other descriptor that is not a libSceNet socket still throws, now naming the descriptor (or saying libSceNet is not loaded). Titles behind it, from #2811: Minecraft Dungeons (PPSA16064) stopped on `select on descriptor 0` and reaches the menu with this change (MisterbALLIN's run); RIDE 4 (PPSA01599) stopped on the same line after OpenSSL opened `/dev/urandom` and gets past it (alfalfa-star's run). The author is under the impression the intake limit stops them from opening this themselves, so I am carrying it with the commits as they are. Closes #2811. ### Tested Linux (Fedora, GCC 16.2.1, Ninja, Release, `-DBUILD_TESTING=ON`), based on current `main` `03a84d02`: - Full build and `ctest`: 826 of 827 pass. The one failure, `agc_driver_pixel_interlock`, is a GPU fragment-shader-interlock race test unrelated to this change (it touches only `Socket.cpp`); it is flaky on this RADV driver and passes on rerun (2 of 3). All `guest_`, `kernel` and `net` tests pass.. - `tools/check_conventions.py --base upstream/main` and `git diff --check` pass. - The author reported `guest_sce_net` with the new random-device and standard-descriptor cases passing on Windows 11, WinLibs GCC 15.2.0 r7. No title was run on this machine. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 10:57:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T10:57:03Z.


Progress report (9a9bd3f → abed1c4)

📈 System libraries: 85.77% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel select_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108295940 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3455#issuecomment-6108295940). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T10:57:03Z. --- <!-- progress-report --> ### Progress report (9a9bd3f → abed1c4) 📈 **System libraries**: 85.77% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel | `select_nid_postfix` | </details>
github-actions[bot] commented 2026-10-11 11:00:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T11:00:44Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#3462 core/libs/prx/libkernel/Socket/src/Socket.cpp L61, L67-68, L79-86, L88-106
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108323925 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3455#issuecomment-6108323925). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T11:00:44Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3462 | `core/libs/prx/libkernel/Socket/src/Socket.cpp` [L61](https://github.com/boykopovar/AnyPS5/blob/08e0079e4d8cb714249a0cf845c50b532ef75380/core/libs/prx/libkernel/Socket/src/Socket.cpp#L61), [L67-68](https://github.com/boykopovar/AnyPS5/blob/08e0079e4d8cb714249a0cf845c50b532ef75380/core/libs/prx/libkernel/Socket/src/Socket.cpp#L67-L68), [L79-86](https://github.com/boykopovar/AnyPS5/blob/08e0079e4d8cb714249a0cf845c50b532ef75380/core/libs/prx/libkernel/Socket/src/Socket.cpp#L79-L86), [L88-106](https://github.com/boykopovar/AnyPS5/blob/08e0079e4d8cb714249a0cf845c50b532ef75380/core/libs/prx/libkernel/Socket/src/Socket.cpp#L88-L106) | | |
adriadam10 commented 2026-10-11 11:49:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:49:03Z.


Checked the build and guest_sce_net on Linux (passes with the change, fails without it), TechnicalDebt entry, and the PR template; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108705011 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3455#issuecomment-6108705011). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T11:49:03Z. --- Checked the build and `guest_sce_net` on Linux (passes with the change, fails without it), TechnicalDebt entry, and the PR template; merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!3455
No description provided.