feat(libc): implement rewind #2354
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2354"
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 Vabian124 on 2026-10-09T16:11:32Z.
What
Guest programs import
rewindfromlibSceLibcInternal(#1578). libc now implements it the way FreeBSD does: seek to the start of the stream, drop a pushed-back character, and clear the end-of-file and error indicators.fseekto the start leaves a guest encoding error set, sorewindclears that afterwards. Titles that import it fromlibSceLibcInternalalready searchlibc.prxfor the symbol.Tested
Windows 11 (10.0.26200), WinLibs GCC 15.2.0, Ninja, Release.
ctest --test-dir build -R guest_standard_streamspassed. The test writes a byte, pushes another character back, rewinds, and reads the original byte. It then reaches end-of-file, sets an encoding error, and checks that rewind clears both indicators and returns to the start.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 Kikoarl on 2026-10-09T17:03:04Z.
Linux run: Linux 7.2 (x86_64), GCC 16.2.1, Release,
-DBUILD_TESTING=ON, #2354 (e5f8fac9) checked out on currentmain(0fdda7be).tests/guest_standard_stream_tests: passes cleanly (fscanf: suppressed conversion passed; assigning register arguments).tools/check_conventions.py: passes cleanly.libcstandard streams test suite.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:12:16Z.
Closing:
rewindcomes from the #1578 import audit, and no title is shown to stop at it on main. Reopen with the title ID and the log line when one does.Pull request closed