feat(libc): export _Getptimes with the console's C-locale time names #11735
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11735"
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 verusferro on 2026-10-27T06:22:06Z.
What
libc did not export Dinkumware's
_Getptimes, which the console'slibc.prxexports. In the SDK 7.00libc.prxthat PPSA06416 ships insce_module/(0x3cdb0, read from its disassembly, REVERSE_ENGINEERING source 2) it islea rax, [rip + ...]; ret: it returns the address of the module's time-name record at 0x1114e0, which is 21 string pointers (0xa8 bytes, the layout of Dinkumware's_Tinfo). Read through the module's relocations, the C-locale record holds::AM:PM;:Sun:Sunday:...:Sat:Saturdayin the three day fields;:Jan:January:...:Dec:Decemberin the three month fields;|%a %b %e %T %Y|%m/%d/%y|%H:%M:%S|%I:%M:%S %pin the ten format fields (date and time, date, time, 12-hour time and their era forms);_Getptimesnow returns the same record, as a staticGuestLocale::TimeInfowith the same pointer sharing.Tested
Ubuntu 24.04 (WSL2) x86-64, GCC 13.3, Release, full build with
BUILD_TESTING=ON, onmain2227f13661:libc.prx, converted by the relinker and loaded in a host process, against this library's unpatchedlibc.prx: both return the same address on a second call, the same 21 strings, and the same fields sharing one string. JJenkx checked the same record in thelibc.prxof 11 more titles.ctest -R '^(guest_locale|patched_libraries|conventions_unknown_nids)$': 3/3 pass.tools/progress.py: +1 implemented. libc goes from 1419/1436 to 1420/1437.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branch feat/libc-getptimes: no conflicting lines and no same exports; the struct sits between twoGuestLocale.hppdeclarations no open PR changes (#11450 changes the lines afterLocinfoStorage). Of the pull requests it could not compare, #7081 and #9526 change other parts ofLocaleSupport.cpp, #10324 and #10749 other lines ofApi.hpp, andgit merge-treeof each with this branch conflicts only in the files where they already conflict withmain.Not tested: Windows, macOS, a title that calls
_Getptimes, a console run.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-27T06:30:14Z.
Review: APPROVED
Reviewed exact head
15a1512169eea3c3fcd9fff0b1f6822c3c086eed. The newTimeInfois exactly 21 pointer fields (the0xa8static assertion checks the reported_Tinfosize), and the static record preserves the string sharing described in the disassembly. The export declaration, implementation, and locale type are all updated together; no repository overlap or behavioral blocker is evident from the diff.The PR reports a full Ubuntu 24.04/WSL2 build and 3/3 focused locale/convention tests. Hosted conventions, intake, labels and Linux/Windows relinker checks pass; macOS relinker jobs remain queued, and the full Linux/Windows product jobs are skipped by repository policy. I did not independently rebuild the full target in this workspace.