Skip to content

feat(libc): implement getw and putw - #7249

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Lorkydey:feat/libc-binary-word-io
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Lorkydey:feat/libc-binary-word-io

Conversation

@Lorkydey

Copy link
Copy Markdown
Contributor

What

Implement the missing getw and putw libc exports for 32-bit little-endian binary words. getw reads through the existing guest fread path, including pushed-back bytes and EOF/error state. putw writes under one stream lock, returns zero on success and reports byte-write failures; concurrent writers cannot interleave a word's bytes. A successfully read -1 remains distinguishable from EOF through the stream indicators.

The word format and return conventions follow FreeBSD 11.4 getw.c and putw.c. Host buffering/error timing and unverified console behavior are documented in the existing libc debt file.

Tested

Windows x64, WinLibs MinGW-w64 GCC 15.2.0, Ninja, Release, BUILD_TESTING=ON in the full runtime CMake configuration:

No Linux runtime, full all-library build or title run. The completed runtime validation is scoped to libc and the tests listed above.

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 (Codex)

@github-actions

Copy link
Copy Markdown

Progress report (922dc89 → 7c07ebd)

➖ System libraries: 89.65% (+0.0%, +2 implemented functions)

✅ 2 implemented
Library Name
libc getw_nid_postfix
libc putw_nid_postfix

@github-actions

github-actions Bot commented Oct 17, 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/CMakeLists.txt
docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 5668 core/libs/prx/libc/CMakeLists.txt
PR 6044 core/libs/prx/libc/CMakeLists.txt
PR 6222 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 6334 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 6483 docs/dev/debt/libc.md
PR 6731 docs/dev/debt/libc.md
PR 6732 docs/dev/debt/libc.md
PR 7081 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7084 core/libs/prx/libc/CMakeLists.txt
PR 7201 core/libs/prx/libc/CMakeLists.txt

@oneandonlydean
oneandonlydean merged commit 8532632 into boykopovar:main Oct 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants