feat(libScePosixForWebKit): implement opendir, closedir, readdir, readdir_r #12386
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12386"
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 PrivacyOnion on 2026-10-28T12:08:24Z.
What
Declare and implement
opendir,closedir,readdir, andreaddir_rinlibScePosixForWebKit, forward them to libc directory operations, and add unit test coverage for traversal and argument validation.Tested
Windows 11 x86_64; verified conventions with check_conventions.py, test registration with check_test_registration.py, no PR overlap with pr_overlap.py, and unit test suite passing. Verified directory traversal, entry properties (nameLength, recordLength, fileNumber), EOF handling, readdir_r, and null/empty/invalid argument rejection.
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 MarcZX10 on 2026-10-28T12:21:35Z.
Review: COMMENTED
Reviewed exact head 0b03cad03a7205155a315d82e4c28deebe24a3d5. The four export names hash to the NIDs listed in the debt note; the wrappers use the existing libc directory API and the traversal/entry/EOF/error tests exercise the important behavior. The documented uncertainty about any PS5-specific WebKit sandboxing or path filtering remains appropriately visible. I found no functional issue in the forwarding code. Exact-head conventions pass; diff --check reports one extra blank line at end of Export.cpp. Hosted Windows is still pending, so I have not approved.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T12:29:19Z.
Review: CHANGES_REQUESTED
The forwarding to the libc directory functions looks right, and the four names hash to the NIDs in the debt note. Two things to fix:
core/libs/tests/GuestPosixFilesystem.cpp:176-205: the new calls passroot.string()/root / "missing-directory", which are absolute host paths. On Linux the guest path resolver maps an absolute path under the guest root, not onto the host, soopendirreturns null and theRequire(testDirectory != nullptr)fails on the Linux job (a drive-letter path only works on Windows). The rest of this test uses the alias; please open"/anyps5-posix-test"and"/anyps5-posix-test/missing-directory"instead.core/libs/prx/libScePosixForWebKit/Export.cpp:285and the end of the file: a double blank line and a blank line at EOF (git diff --check).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:40:38Z.
Review: APPROVED
Re-checked — approved
The two issues from review are resolved: the fixture now uses guest path aliases, and the trailing blank lines are gone. The four ABI wrappers still forward directly to the existing directory API, and the added tests cover null/missing paths, traversal, EOF, record fields, and close/read errors.
What I ran
634e7eb41fb02b44068bf664de34cf72a744741cagainst currentmain52c09d567d2fa453494dd720fcf53a98149468e4.git merge-tree --write-tree,git diff --check, andpython3 tools/check_conventions.py --base refs/review/main-20261029c --head refs/review/pr-12386-latest.Results
git diff --checkguest_posix_filesystemI did not run the C++ test locally. The author’s exact-head run and the clean integration resolve the remaining review points.