feat(libc): query filesystem statistics by guest path #3658
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3658"
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 Lorkydey on 2026-10-11T14:58:16Z.
Continued in #4653. The replacement is rebased onto current main and includes the new EmuStore/PS5SX2 evidence and Linux/Windows validation. GitHub refused reopening this PR after the rebase.
What
EmuStore (PPSA97631) stops on the missing path-based
statvfsimport fromlibSceLibcInternal:Nixitov's Windows validation reports that this PR resolves the import and the title proceeds to
sysctlbyname_nid_postfix: unsupported name kern.sdk_version. That later stop is outside this change.Rebased onto
main2a5eca11cd1bf583db39ce67034e8453842ac244, which already contains #3596. This PR adds onlystatvfs; it reuses the mergedfstatvfsimplementation and leaves its ABI conversion and tests unchanged. The diff contains four files and adds one implemented library function. There is no remaining dependency on an open PR.Resolve the guest path, open a temporary metadata descriptor, and pass it to
fstatvfs. Windows uses a zero-accessCreateFileWhandle; Linux usesO_PATH | O_CLOEXEC. This supports directories, files without read permission, and FIFOs without opening their contents. The Linux backend accepts filesystem sockets opened withO_PATH; ordinary socket descriptors retain their existing rejection. Temporary descriptors close with errno preserved.The rebase also adapts path resolution errors to the current helper: unavailable mounts return
ENOENT, andfile/../...returnsENOTDIRinstead of letting a filesystem exception abort the program.Additional title evidence: babyhuey's PS5SX2 (PPSA99203) report reaches the same missing import on Linux and Windows, using
maind592d54ewith #3804, #4466, #4382, #4530, #3787 and #4426 for that title's earlier stops. The title stack is recorded there astest/verify-sx3at49c7676e. These title observations are attributed to those testers; I have not rerun either title on the rebased head.Tested
Head:
c052b7c720501f0b49527194baf625d8a4a50152.BUILD_TESTING=ON: six targeted tests pass, repeated three times each:guest_statvfs,guest_fstatvfs,guest_fstatvfs_conversion,guest_fstatfs,guest_utimeandguest_utime_forwarding.statvfsimplementation on current main; it passes after usingResolvePathError_nid_no_patch.libstarget both succeed.git diff --checkpass. The repository overlap checker found no overlap with the other open PRs at the time of this update; all-state searches found no other path-basedstatvfsimplementation.Checklist
main; no other open PR implements the same function.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T14:58:38Z.
Progress report (
a11c8f7→1fc82ce)📈 System libraries: 85.82% (+0.01%, +2 implemented functions)
✅ 2 implemented
fstatvfs_nid_postfixstatvfs_nid_postfixImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T15:19:33Z.
Independent pre-review on Linux (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.tools/check_conventions.py --base origin/mainpasses.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:16:09Z.
Has PS5MC (PPSA99420) been run on main? With the log line where it stops at
statvfsthis can go in; otherwise I'll close it until a title reaches it.Imported from boykopovar/AnyPS5. Originally posted by Lorkydey on 2026-10-11T23:32:24Z.
@oneandonlydean No, I haven’t run PS5MC on main. The evidence is a static import audit, as noted in the PR description
it doesn’t establish that execution reaches statvfs.
I don’t have the requested runtime log so I understand closing this until a title is confirmed to hit it.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T07:36:57Z.
Closing as agreed above; reopen when a title reaches
statvfs.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-12T15:30:45Z.
@Lorkydey @oneandonlydean a title now reaches
statvfsat runtime: PS5SX2 (PPSA99203). It is a ps5-payload-dev SDK title, so it relinks only with--trap-sdk-syscall-stubs(#3804), and it needs these open PRs for its earlier imports: #4466, #4382 (setitimer), #4530, #3787 (JIT shared memory) and #4426. With those stacked onmaind592d54e, it stops atstatvfson both systems:app.elf: symbol lookup error: app.elf: undefined symbol: ayTeobcoGj8 (statvfs)FAIL: unresolved ELF import ayTeobcoGj8 (statvfs) from libSceLibcInternal.prxThe stack is on my fork as
test/verify-sx3(49c7676e) if you want to reproduce it.Imported from boykopovar/AnyPS5. Originally posted by Nixitov on 2026-10-12T16:48:16Z.
Verified on Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release: the branch builds (patched
libc.prx).mainit stops atFAIL: unresolved ELF import ayTeobcoGj8 (statvfs) from libSceLibcInternal.prx; with this changestatvfsresolves and the title loads fully, then stops at run time onsysctlbyname_nid_postfix: unsupported name kern.sdk_version(a separate, already-open change).Note: #3596 adds volume statistics through
fstatvfs; please confirm the two don't overlap before merging both.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by Lorkydey on 2026-10-12T18:04:58Z.
@babyhuey @Nixitov @oneandonlydean
Thanks for the title reports, ive opened #4653 as the updated replacement for this PR, since GitHub wouldn't let me reopen it after rebasing.
It now reuses the already-merged #3596 without duplicating it. Linux and Windows validation passes, and I've included your EmuStore and PS5SX2 reports in the description.
Pull request closed