feat(libc): implement rewind #3198
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3198"
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 adriadam10 on 2026-10-11T00:55:13Z.
What
rewind(3QIPIh-GDjw, imported fromlibSceLibcInternal) isn't exported. Since #1529, Linux bindslibSceLibcInternalimports to the system libraries instead of the title's bundledlibc.prx, so these four catalog homebrew titles now stop on it at load onmain:mainf1ae427b6./app.elf: symbol lookup error: ./app.elf: undefined symbol: 3QIPIh-GDjwIt follows FreeBSD 11
lib/libc/stdio/rewind.c:errnoif the seek succeeded;It goes through the existing
fseekoandclearerrpaths, so a character pushed back withungetcis dropped and the guest encoding-error flag is cleared too.This is the same function as the closed #2354, which had no title stopping on it at the time.
Tested
Linux (CachyOS), GCC 16, Release.
guest_standard_streamspasses. The new cases:rewindafter a write keepserrnoand returns to offset 0;ungetcis dropped;errnoisESPIPE(29) and the indicators are still cleared.mainthe test doesn't link (rewind_nid_postfixis undefined).errnoafter a failed seek too, not clearing, clearing only after a successful seek, and not seeking. Removing the restore on success survives: the host'sfseekodoesn't toucherrnowhen it succeeds, so that line can't be seen here. It's kept to match FreeBSD.main's relinker and launched. Each stops at load with the line above.tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T00:55:34Z.
Progress report (
06da117→e7605c8)➖ System libraries: 85.96% (+0.0%, +1 implemented functions)
✅ 1 implemented
rewind_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T01:03:18Z.
Merged with Linux CI red only on the three AGC tests main has been failing since
3c46fa6f4(agc_unit_shadow,agc_driver_flat_apertures,agc_driver_image_packed16_load). I'm on those now. Windows passed, andguest_standard_streamspassed on both.