feat(libkernel): open /dev/random and /dev/urandom for reading #1777
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1777"
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 MathiasDevelopes on 2026-10-08T18:58:35Z.
What
/dev/randomand/dev/urandomresolved to files under the guest root that do not exist, soopenfailed. Titles that read entropy from them then read from the failed descriptor: Planet Coaster (PPSA01736) aborts insceKernelReadwithfd=-1, errno=9.Opening either path for reading now returns a descriptor backed by the host's null device.
read,pread,readvandpreadvon it fill the buffer fromstd::random_device, the sourcesceRandomGetRandomNumberalready uses. As on FreeBSD, both devices behave the same and positioned reads ignore the offset. Opening them for writing (adding entropy) throws. Closing a descriptor, throughcloseorsceKernelClose, forgets it.Tested
Windows 11, MinGW-w64 15.2.0.
guest_filesystemopens both paths and checksread.guest_file_vectorchecksreadv,preadvandpreadon/dev/urandom. The full ctest suite passes (476/476), andtools/check_conventions.py --base origin/mainpasses. With this change, Planet Coaster (PPSA01736) no longer aborts reading/dev/urandomat startup. Linux: built and run only through the shared code; the Linux-onlypread,readvandpreadvbranches are not run on Linux.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-08T18:58:40Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T03:18:56Z.
This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:19:09Z.
Rebased onto current main (conflicts were only include/source-list adjacency); build and the affected tests pass on Linux (400/400).
Also added one commit: a "Functional" line in
docs/dev/TechnicalDebt.mdfor the unverified choices (both devices identical, never block, positioned reads ignore the offset, only the exact paths recognised,duped descriptors read as empty, write-open throws).Merging once CI is green on the new head.