feat(libSceLibcInternal): implement ten unversioned std::filesystem helpers #15665
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15665"
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 HilalElusive on 2026-11-04T01:19:53Z.
What
Implement ten unversioned
std::filesystemhelpers inlibSceLibcInternal, replacing their numbered throwing placeholders (sceLibcInternalPending4_117to_129) inExport.cpp. Their names and NIDs come from the PS5 3.20 export inventory; no module was read for them and no console was measured._Stat(const char*, perms*),_Lstat(const char*, perms*)and_File_size(const char*)call this library's existing overloads that take an error output, passing none._Last_write_time(const char*)calls the existing(path, seconds*, nanoseconds*)overload and returns -1 when it fails, else the seconds._Set_last_write_time,_Rename,_Resize,_Copy_file,_Statvfsand_Current_set2call libc's matchingstd::__sce_v2::filesystemhelpers, which follow thelibc.prxbundled with PPSA03671 (docs/dev/debt/libc.md). This assumes both namespaces build the same Dinkumware sources, as libc's versioned_Open_dir,_Read_dir,_Close_dirand_Current_getalready reuse the unversioned implementation. So_StatvfsreturnsENOSYSwith unknown space and_Current_set2accepts only"/", as in that module._Equivalent,_Current_setand the three-argument_Xfilesystem_errorkeep their placeholders: no source gives their behaviour, and #15486 is reworking the filesystem exception path. The ten inventory entries are removed fromdocs/dev/debt/libSceLibcInternal.md, and the remaining gap is recorded under Functional.Overlap: no open pull request touches these ten exports or their placeholders. The new code is in its own
UnversionedFilesystemCalls.cpp, so #15126's changes toFilesystem.cppdo not conflict. The declarations, the build block and the debt entry are placed where no other open pull request edits. Only #14212, which adds a blank line between every debt entry, conflicts with the new entry.Tested
Ubuntu 24.04 x86-64, GCC 13.3.0, Release full configure with
BUILD_TESTING=ON; no title.guest_libc_internal_unversioned_filesystem: types, permission bits, missing paths and a followed link through_Stat/_Lstat; file size and missing size; write times set and read back for positive, negative and sub-second microsecond values, and a missing file; rename, rename over a directory and of a missing file; growing and shrinking resize; copying a file larger than one 64 KiB block, a missing source and a directory target;_StatvfsreturningENOSYSand writing only three fields;_Current_set2with"/"and another path. Five deliberate faults (seconds swapped for nanoseconds,_Renamesent to_Copy_file, a zero size,_Current_set2accepting everything, the permission output dropped) each made it fail.guest_libc_filesystem,guest_sce_v2_filesystem_calls,public_headersand all 65public_headers_compile_*batches pass.nm -DonlibSceLibcInternal.prxlists the ten exports.python3 tools/check_conventions.py --base upstream/mainpasses.python3 tools/pr_overlap.py --branch feat/libc-internal-unversioned-filesystem(1827 open pull requests) reports no conflicting files and no shared exports. It could not compare seven pull requests that conflict withmain(#5021, #13486, #13778, #13782, #14212, #14401, #14837), so I merged this branch with each of them and with every other open pull request touching these files usinggit merge-tree. Only #14212 conflicts with this branch's lines, as described above.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)