Skip to content

fix(libc): translate native stream write errors - #14559

Merged
oneandonlydean merged 6 commits into
boykopovar:mainfrom
Queuse:codex/stdio-write-errno-20261101
Nov 11, 2026
Merged

oneandonlydean merged 6 commits into
boykopovar:mainfrom
Queuse:codex/stdio-write-errno-20261101

Conversation

@Queuse

@Queuse Queuse commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Translate newly reported host CRT errno in ordinary-stream fwrite, fputs, fflush, fputc and putc_unlocked, including aliases and all-stream flush. A full nonblocking pipe exposes Linux EAGAIN 11 where the guest expects 35. Capture errors before status synchronization and preserve incoming guest errno when the native call reports no new error, including recovery while the stream error flag remains set. Preserve return values, partial element counts, validation and stream-mode handling.

Rebased after #10324 merged, preserving main's stream-orientation calls. The agreed integration order is fulfilled; this change has no remaining runtime dependency.

Tested

Head 7a62af9976fa6d7ac8a96240f3e8686a609b95f4, refreshed against main bf80054e7cf794320f656c93f3f299d55f336440.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 core/libs/prx/libc/src/StandardStreams.cpp
PR 7447 core/libs/prx/libc/src/FileAndHeap.cpp
PR 8150 core/libs/prx/libc/src/StandardStreams.cpp
core/libs/tests/FileStreams.cpp
PR 9526 core/libs/prx/libc/src/FileAndHeap.cpp
PR 12682 core/libs/prx/libc/src/FileAndHeap.cpp
PR 12688 core/libs/prx/libc/src/FileAndHeap.cpp
PR 12700 core/libs/prx/libc/src/FileAndHeap.cpp
PR 12965 core/libs/prx/libc/src/FileAndHeap.cpp

@Queuse
Queuse marked this pull request as ready for review November 4, 2026 23:44
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@Queuse

Queuse commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

I checked the failed Windows relinker job on 4635e7fdb4: the build completed and 708/712 tests passed. The four failures are timeouts in web_release and the three check_compile_modes driver-query cases; this job does not build the changed libc code.

I reran those four tests serially on Windows against the same source tree: 4/4 pass, taking 3.28, 7.74, 2.69 and 5.16 seconds. I also rebuilt libc and reran file_position, file_stream_status, file_streams, guest_standard_streams and guest_fwide: 5/5 pass.

Could a maintainer rerun the failed Windows relinker job on this unchanged head? The hosted failure remains pending that rerun.

Update: the current head is 7a62af9976fa, and its Windows relinker job passed. The same run also rebuilt and passed the changed Windows guest test (file_streams, 1/1). The earlier timeout report concerns the superseded head; the rerun request above is no longer pending. Full-product CI and the Linux runtime job remain unrun.

@JJenkx

JJenkx commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 7a62af9976, merged onto main 3926edb1bb (a7c42533e2, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • file_streams passes in 3 of 3 runs, none skipped.

AI-assisted: yes.

@oneandonlydean
oneandonlydean merged commit 0effa48 into boykopovar:main Nov 11, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants