feat(libc): implement guest fstatvfs volume statistics #3596
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3596"
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-11T13:59:30Z.
What
PS5MC 1.2 (PPSA99420, Kodi 22) imports
fstatvfsfromlibSceLibcInternal, but maina11c8f7fdoes not export it. Its public release has an undefined dynamic function symbol at index 452, NID6IM2up2+a-A, mapped to that library. The existing_fstatfsimplementation from #2858 provides the kernel data; this PR adds the missing libc conversion and export.Convert those real volume statistics into the 88-byte guest
statvfslayout: retain 64-bit block and inode counts, distinguish I/O and fragment sizes, translate read-only/nosuid flags, and propagate backend errors without changing the output on failure. Extract the existingKernelStatfsdefinition unchanged into a shared header. Success preserves guest errno and the descriptor position; a null output returnsEFAULTafter descriptor validation.Layout and conversion semantics follow FreeBSD 9.2's statvfs definition and libc conversion. The name limit comes from the existing kernel volume query. This inherits
_fstatfs's platform coverage, including zero inode counts on Windows; it does not introduce invented inode values or implement the separate path-basedstatvfsexport.Tested
Windows 11 Pro 26100, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON.
undefined reference to fstatvfs_nid_postfix.guest_fstatvfs,guest_fstatvfs_conversion,guest_fstatfs,guest_utime, andguest_utime_forwarding(0.40 seconds total).libSceLibcInternal.prxexports6IM2up2+a-A.fstatvfsimplementation; #2858 implements the distinct kernel_fstatfsbackend.tools/progress.py: libraries 2903/3383 (85.81%) -> 2904/3384 (85.82%). This adds one implemented function to the source counter.Title evidence: public PS5MC 1.2 Kodi 22 release, archive SHA256
5a9eeff4a0024a341a4924b8d283fe65b4ff94d7f5dbea446c8a677c4db157b6, inspected without execution. PS5MC was not launched; the import audit does not establish this as its first startup failure. Linux and macOS runtime tests were not run locally.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T13:59:52Z.
Progress report (
951fd9a→c81ee92)➖ System libraries: 85.62% (+0.0%, +1 implemented functions)
✅ 1 implemented
fstatvfs_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:39:58Z.
Checked the
statvfslayout and thestatfs→statvfsconversion against FreeBSD 9.2 (statvfs.h,sfs2svfs): fields, flags,f_bsize/f_frsizeandf_favailmatch. Build and the 119 scoped ctest tests pass on Linux, and the new tests fail to link without the change.Added one commit on top (rebased on current
main):docs/dev/TechnicalDebt.md: a line under "Functional" for the deviations (f_namemaxtaken fromstatfsinstead offpathconf, negative counters wrap withoutEOVERFLOW, zero inode counts on Windows,EFAULTon a null output).Merging once CI is green.