feat(libc): query filesystem statistics by guest path #4653
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4653"
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-12T17:55:55Z.
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.Replaces #3658, which was closed pending title evidence. GitHub refuses to reopen it after the branch was rebased; the new title reports above and below supply the missing evidence.
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-12T18:02:47Z.
Progress report (
2a5eca1→c052b7c)➖ System libraries: 86.34% (+0.0%, +1 implemented functions)
✅ 1 implemented
statvfs_nid_postfixImported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T19:54:01Z.
Windows test: head
c052b7c72merged onto currentmain1b92f7f5d(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest with the filterguest_statvfs: guest_statvfs passed (1 test(s), 0 failed);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T21:08:13Z.
Checked on Linux, merged onto current main: build and scoped ctest (151 tests) pass,
guest_statvfspasses and the library no longer links without the change. Path resolution errors (ENOENT,ENOTDIR,EFAULT), buffer bounds and descriptor cleanup with errno preserved look right; Windows runs by @Nixitov and @xXPBSXx cover that side. Merging.