Repository navigation
feat(libc): implement wcsftime - #4226
Conversation
|
Carried #3625’s ready commit onto current main; the author is preserved. Local conventions and diff checks pass, but Linux CMake configure is blocked here by the missing SDL2 submodule contents and audio development headers, so the PR body records the original Windows test results and local limitation. |
|
Rebase handoff — rebased onto current Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
To pick it up: |
6817bb1 to
a6eda34
Compare
a6eda34 to
b870ffc
Compare
b870ffc to
21a48a8
Compare
|
Needs a rebase ( |
|
Thanks. The current PR head still conflicts with main. I will rebase it, keep the existing strftime debt entry, and remove the duplicate kern.arandom line before asking for review again. |
PS5MC (PPSA99420) imports wcsftime (XbVXpf5WF28, aerolib) as the last
absent libSceLibcInternal import in its registry order (index 481), so
its predicted stop is:
FAIL: unresolved ELF import XbVXpf5WF28 from libSceLibcInternal.prx
The stop is predicted from the import order, not observed in a run.
wcsftime follows FreeBSD 11.4 lib/libc/locale/wcsftime.c (8c639945):
the wide format is converted with wcsrtombs, strftime fills a buffer of
maxsize * MB_CUR_MAX bytes limited to maxsize, and mbsrtowcs converts
the result back. A format unit that the single-byte C locale of
lib/libc/locale/none.c cannot encode returns 0 with EILSEQ, a maxsize
whose product with MB_CUR_MAX overflows returns 0 with EINVAL, and an
empty or overflowing result or a null buffer returns 0 with errno
unchanged; the ERANGE or EINVAL set by the Windows CRT's strftime is
discarded. A null format or tm throws, as FreeBSD dereferences it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
21a48a8 to
78ffdf0
Compare
|
Rebased the PR onto current |
|
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.
|
What
Adds the missing
wcsftimeexport for PS5MC (NIDXbVXpf5WF28) using the guest's 16-bit wide strings and the existing C-locale conversion routines. The implementation follows FreeBSD 11.4 behavior for conversion errors, empty/truncated output, overflow, and null arguments, including restoring errno around Windows CRTstrftimebehavior. Adds regression coverage toguest_wide_formattingand records the source behavior indocs/dev/debt/libc.md. The original implementation commit author is preserved.Tested
Checklist
main; no matching open PRwcsftimeexport and its tests/documentationstrftimetechnical-debt entrykern.arandomline while preserving the existing entry