feat(libc): implement swscanf #4467
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4467"
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 arcwiser on 2026-10-12T12:40:49Z.
What
Implement the missing 16-bit guest
swscanfexport by sharing the existingswscanf_sscanner without consuming the secure buffer-size arguments after string, character and scanset conversions. Keep the existing refusal behavior for unsupported conversions and widen the documented scanner limitations to cover both entry points.Add regression coverage for integer, floating-point, string, character, scanset,
%n, suppression, width, partial-match, EOF, null-input and unsupported-format behavior.This carries screamm's offered commit from issue #4464 unchanged and preserves its authorship.
Closes #4464.
Tested
BUILD_TESTING=ONguest_wide_conversion_testsand its 52-step libc dependency target successfullyctest --test-dir build -R '^guest_wide_conversion$' --output-on-failure(3/3 passed)python tools/check_conventions.py --base origin/maingit diff --check origin/mainpython tools/check_test_registration.py build(705 executables, none unregistered)Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T12:41:19Z.
Progress report (
bf8dc61→8aa0d42)➖ System libraries: 88.18% (+0.0%, +1 implemented functions)
✅ 1 implemented
swscanf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-12T13:56:41Z.
The
swscanfstop is now observed at runtime, not just predicted. PS5CEMU-HAR (PPSA99360, catalog 3.5.0) on Windows 11 (26300), WinLibs GCC 15.2.0, Release, relinked with--windows --trap-sdk-syscall-stubs. Each step adds one change ontomainf8dee0595:mainunresolved ELF import avvJ3J0H0EY from libkernel.prx(sceKernelJitCreateSharedMemory, #3787)File/srcconflicts withmainresolved by keeping both sides)unresolved ELF import 5KWrg7-ZqvE from libkernel.prx(pthread_setaffinity_np)feat/libkernel-setaffinity-siglist(827a8c87)unresolved ELF import HNnWdT43ues from libSceLibcInternal.prx(swscanf)feat/libc-swscanf(569cb122, the same patch as this PR's462830939pergit range-diff)unresolved ELF import ELSr5qm4K1M from libSceLibcInternal.prx(__umodti3, #4462)So with #3787 and
pthread_setaffinity_npin, this PR moves the title fromswscanfto__umodti3. TheUnblocksline could name PPSA99360 (withDepends on: #3787), if you agree. I'm opening a PR that carries screamm'spthread_setaffinity_npcommit, the one part of #4463 not carried yet.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-13T10:55:50Z.
Windows validation with title evidence (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs; basemaind379bfd0with #5025 applied for the title runs (without it currentmaincannot loadlibkernel_sys.prxon Windows, #4877)):46283093merged ontod379bfd0(one trivial conflict: the bullet now belongs indocs/dev/debt/libc.md). Same lines as my569cb122.guest_wide_conversion3/3; suite 686/688 (guest_sce_netpasses serially,patched_librariesismain's #4877 failure); conventions andgit diff --checkpass.PS5CEMU-HAR (PPSA99360): with #4514 in, the title's stop is
FAIL: unresolved ELF import HNnWdT43ues from libSceLibcInternal.prx(this export); with #4514 + #4469 + this PR it runs the whole minute atPS5CEMU-HAR | FPS: 59.93 (3483), launcher[ui] frames=3001 avg=16.68 ms.Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T14:38:35Z.
Title run with this PR: Windows 11, MinGW GCC 15.2.0 (WinLibs), Release, on
main3faa9cb40merged with this PR and the other open PRs the catalog titles need; PS5CEMU-HAR (PPSA99360) from its catalog release, converted with--trap-sdk-syscall-stubs(it has a forbidden inline syscall otherwise),eboot.binkept inapp0.tools/import_audit.pylists no absent import for PS5CEMU-HAR (onmainswscanf,sys_siglist,sys_nsigandpthread_setaffinity_npare absent) and it runs the whole 60 s with no exception.mainonly indocs/dev/TechnicalDebt.md:mainnow keeps debt indocs/dev/debt/<library>.md(python tools/debt_split.py resolvemoves the entry).AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-13T19:17:04Z.
Rebase handoff — rebased onto current
main, authorship unchanged. This one needed the full per-library routing: the PR'sTechnicalDebt.mdconflict carried 107 debt entries from before the ledger restructure (#4411) — each is routed to itsdocs/dev/debt/<name>.mdby firstcore/link, with relative links adjusted for the deeper directory.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727)To pick it up:
Head is
1818ddb38.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T21:05:04Z.
Conflicts with main in
docs/dev/TechnicalDebt.md; the swscanf entry now goes indocs/dev/debt/libc.md, please rebase. Also list #4514 under Depends on and PPSA99360 under Unblocks, since screamm's run shows the title stops atHNnWdT43uesonce #4514 is in.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T22:20:03Z.
Rebased onto main (
bf8dc610e6) and force-pushed: the swscanf debt entry now sits indocs/dev/debt/libc.mdwith main's other entries, anddocs/dev/TechnicalDebt.mdis as on main. The commit and its author are unchanged.Please update the description: #4514 (merged) under Depends on, PPSA99360 under Unblocks.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T22:26:06Z.
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)docs/dev/debt/libc.mdL65-66