feat(libc): export timezone and daylight #8324
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8324"
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 hypermoist on 2026-10-20T10:06:02Z.
What
Adds the missing
timezone(-Oet9AHzwtU, 8 bytes) anddaylight(tOicWgmk4ZI, 4 bytes) data exports. The decryptedlibSceLibcInternal.sprxkeeps both in.bss(0x1c3260,0x1c3268), so they are 0 untiltzsetruns, and onlytzset(gYFKAMoNEfo) writes them:t = time(0), thenmktime(gmtime(&t))andmktime(localtime(&t));timezone = (long)difftime(first, second)(vcvttsd2siinto[0x1c3260]). Becausegmtimeclearstm_isdst, this is the standard offset in seconds west of UTC, even while daylight saving is in effect.daylight = localtime(&t)->tm_isdst >= 0(not eax; shr eax, 0x1finto[0x1c3268]). So it is 1 whenever the zone's daylight saving state is known, not only for zones that have daylight saving.tzset_nid_postfixnow computes both the same way through the guesttime,gmtime_s,localtime_s,mktimeanddifftime. Upstream refreshestznameon an implicit TZ change; these two are left totzset, as in firmware.Tested
Linux (CachyOS, GCC, Release).
guest_time_conversion_testspasses with new checks:UTC+3gives 10800 / 1;EST5EDTgives 18000 / 1 on any date.guest_mktime_testsstill passes.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)🤖 Generated with Claude Code
https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T10:20:50Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/src/Time.cppL522, L532-534Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libc/src/Time.cppcore/libs/prx/libc/src/Time.cppcore/libs/tests/GuestTimeConversion.cppcore/libs/prx/libc/src/Time.cppImported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T12:54:15Z.
Windows data point for
e201141e0merged ontomain44e3389c8(clean,git merge-treerc 0): Windows 10.0.19045, MinGW-w64 GCC 15.2.0, Release.ctest -N -R '^guest_time_conversion$'lists exactly that one test;ctest --no-tests=error -R '^guest_time_conversion$'was run three times per tree.core/libs/prx/libc/src/Time.cpprestored tomain(the new test cases kept):guest_time_conversion_testsdoes not link (undefined reference to 'timezone_nid_postfix'and'daylight_nid_postfix'), so there is nothing to run without the change.Not tested: other platforms, a title run.
AI-assisted (Claude Code).