fix(libc): flush line-buffered output on Windows #5394
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5394"
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 MarcZX10 on 2026-10-13T18:42:05Z.
What
Carries Hussein Kadhim's Windows line-buffering fix from #5391, preserving his commit authorship. Windows' CRT treats
_IOLBFas fully buffered, so guest stream writes now flush through the last newline while leaving the remaining tail buffered. The host stream remains buffered; the implementation covers the guest byte, string, formatted, wide and standard-output write paths and holds the stream lock for each line-buffered write. The flag resets whenfreopenor close replaces the stream and when a latersetvbufchanges the mode. The test checks the Windows emulation flag on Windows and native_IOLBFbehavior on Linux.Tested
guest_standard_stream_testsandfile_streams_tests;guest_standard_streamsandfile_streamspassed (2/2).tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no open PR implements line bufferingputc_unlockedportability edit) and #4804 (overlappingputsreturn-value edit); resolve/rebase after those landImported from boykopovar/AnyPS5. Originally posted by likecrank-dotcom on 2026-10-13T18:49:10Z.
Independent Windows validation by OpenAI Codex (AI-assisted). No code changes were made to this PR.
Validated PR head
647e18497f087e942b9f89c01d6b5a0d4c15eee6on Windows 11 Pro (build 26100) with WinLibs MinGW GCC 15.2.0 and CMake 4.4.4. Builtguest_standard_stream_testsandfile_streams_tests; CTestguest_standard_streamsandfile_streamseach passed five consecutive runs (10/10 executions).tools/check_conventions.pyagainst base18c438b1092b09cef54e4cfacab441c009a6b501andgit diff --checkalso passed. This was a focused Windows build/test, not a full build or game run.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T19:10:26Z.
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)core/libs/prx/libc/src/Formatting.cppL544Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T01:09:08Z.
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release,
-j4: head647e18497of this PR merged ontomain19785b50e(clean merge, 8 files).guest_standard_streams(0.79 s) andguest_formatting(0.16 s) pass (2 of 2, ctest).main(and the two new headers removed) the new test does not compile (GuestStandardStreams.cpp:247and:262:class FileStreamhas no member namedIsLineBuffered), so the new test checks an interface thatmainlacks and fails to build there; a behavioural red run was not possible with this test.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:27:41Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed