Skip to content

feat(libc): implement tzset - #3124

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
babyhuey:feat/libc-tzset
Oct 10, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
babyhuey:feat/libc-tzset

Conversation

@babyhuey

@babyhuey babyhuey commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements tzset (gYFKAMoNEfo) in libc. It calls the host's tzset (_tzset on Windows), so a guest that changes TZ and calls tzset gets the new zone from localtime and the other conversions, which already go through the host time zone.

PS5MC (PPSA99420) stops at it on main f38a036 (catalog build, eboot.bin and sce_module/libc.prx unwrapped as #2605 requires, with #1529 in; tracked in #1578):

  • main, Linux: app.elf: symbol lookup error: app.elf: undefined symbol: gYFKAMoNEfo
  • with this PR, Linux: app.elf: symbol lookup error: app.elf: undefined symbol: 0NJDcQ2B8vE (execvp, fix(libkernel): export execvp #2827)

Tested

Linux (Ubuntu 24.04, GCC 13, Release) on f38a036: guest_time_conversion passes 5/5 (--repeat until-fail:5). The new case switches TZ from UTC-2 to UTC-5, calls tzset, and checks that the epoch converts to 05:00 with tm_gmtoff 18000; it fails if tzset doesn't re-read TZ. check_conventions.py passes. Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, Release): guest_time_conversion 5/5 with no warnings, so the UTC-5 case passes through _tzset too. The Windows loader reports FAIL: unresolved ELF import 0NJDcQ2B8vE (execvp) from libkernel.prx first for PS5MC, on main and with this PR, so it reaches tzset there only once #2827 is in.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@github-actions

Copy link
Copy Markdown

Progress report (4fb937a → 502dae1)

📈 System libraries: 84.91% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libc tzset_nid_postfix

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux: guest_time_conversion passes, and the test fails to link without the change. localtime_r on glibc does not re-read TZ after init, so the new case does exercise the export. Merging once CI is green.

@adriadam10
adriadam10 merged commit 99a82eb into boykopovar:main Oct 10, 2026
14 checks passed
@babyhuey babyhuey mentioned this pull request Oct 11, 2026
9 tasks done
@reyani-dev reyani-dev mentioned this pull request Oct 11, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants