feat(libc): implement readdir_r #3635
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3635"
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 MarcZX10 on 2026-10-11T14:29:32Z.
What
Related to #3556. Implements the missing
readdir_rexport inlibc(J0kng1yac3M). It reads through the same locked directory-stream helper asreaddir, copies the guest record'srecordLengthbytes, returns the caller's entry throughresult, and preserveserrnoon success and at end of directory. Read errors are returned as error numbers; a null stream returnsEBADF, while null output pointers throw.The behavior follows FreeBSD 11.4's
readdir.c; the PS5 payload SDK lists the export inlibSceLibcInternal. VLC's import registry predicts this as its next missing import aftergetlogin_r. This PR covers onlyreaddir_r: open PR #3606 independently implementsgetlogin_r.This carries David's implementation commit
01085afewith its author metadata preserved. I added a regression for a nullresultpointer.Sources: FreeBSD 11.4
readdir.c, PS5 payload SDK libc stubs.Tested
guest_directory_tests;guest_directorypassed 1/1.python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpassed.guest_directory. The repository'scheck_test_registration.pycould not run because it invokes Ninja and Ninja is unavailable in this environment.Checklist
main; no other open PR implementsreaddir_r(open PR #3606 implementsgetlogin_r)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebtImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T14:29:53Z.
Progress report (
1acfa7f→32b0c8d)📈 System libraries: 86.37% (+0.01%, +1 implemented functions)
✅ 1 implemented
readdir_r_nid_postfixImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T15:00:01Z.
Cross-linking for the review: this implements half of the fix tracked in #3556 (
readdir_r; thegetlogin_rhalf is in #3606), which has an independent Linux verification on that issue — full suite 832/832 (CachyOS, GCC 16.2.1, including the Vulkan suites on AMD RX 9070 XT / RADV), conventions check clean.