Skip to content

feat(libc): implement clearerr_unlocked, fileno_unlocked and fgetln - #7282

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
T3cm0:bionic/unlocked-stream-queries
Oct 18, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
T3cm0:bionic/unlocked-stream-queries

Conversation

@T3cm0

@T3cm0 T3cm0 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

What

Implements clearerr_unlocked, fileno_unlocked and fgetln following the console's decrypted libSceLibcInternal.sprx (SDK 4.5x build of J03950001): clearerr_unlocked clears the stream's end-of-file and error flags as clearerr does, fileno_unlocked returns -1 for a null stream instead of dereferencing it, and fgetln is a hlt instruction on the console, so it throws (recorded in the debt file). getw and putw are left to #7249.

Tested

Windows 11 (MinGW GCC 15.2) and Ubuntu 26.04 on WSL2 (GCC 15.2), Release builds: ctest for guest_standard_streams passes on both, with all of this batch applied together and on its own. Compared with the console's own exports on a PS5 (firmware 13.60) from a homebrew payload that resolves them by NID: clearerr_unlocked and fileno_unlocked; fgetln was not run, as its hlt would end the probe; the results match this implementation except where the debt file says otherwise. Not tested with a title.

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

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the open PR limit Closed over the open PR limit: 1 without merged PRs, 20 with at least 1, none from 20 label Oct 17, 2026
@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Authors with no pull requests merged into main can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.

@github-actions github-actions Bot closed this Oct 17, 2026
@github-actions github-actions Bot removed the open PR limit Closed over the open PR limit: 1 without merged PRs, 20 with at least 1, none from 20 label Oct 17, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 17, 2026
@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/src/StandardStreams.cpp
docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 5668 core/libs/tests/GuestStandardStreams.cpp
PR 6044 core/libs/tests/GuestStandardStreams.cpp
PR 6222 core/libs/prx/libc/src/StandardStreams.cpp
docs/dev/debt/libc.md
PR 6334 docs/dev/debt/libc.md
PR 6483 docs/dev/debt/libc.md
PR 6565 docs/dev/debt/libc.md
PR 7039 docs/dev/debt/libc.md
PR 7081 docs/dev/debt/libc.md
PR 7201 core/libs/prx/libc/src/StandardStreams.cpp

@oneandonlydean
oneandonlydean merged commit 6eea4e0 into boykopovar:main Oct 18, 2026
4 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