fix(libc): match fdopen bad-descriptor stream behavior #24406
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24406"
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 jagdishpanada2000-cloud on 2026-11-20T15:51:07Z.
What
libcfdopen_nid_postfixreturn a stream for a closed/unknown descriptor (instead ofNULLwithEBADF) to match the PS5 firmware 13.60libSceLibcInternalbehavior documented indocs/dev/debt/libc.md.fflushandfclosefail withEBADF, and read/write/seek/tell operations do not reportEBADF(other outcomes for those operations remain unverified and are not claimed).core/libs/tests/GuestStandardStreams.cppto cover the measured behavior and add the corresponding debt fragment (docs/dev/debt/changes/fix-libc-fdopen-bad-descriptor.md).Tested
build-fullNinja build):tests\guest_standard_stream_tests.exepassed (exit 0), including the updated closed-descriptorfdopencase (fflush/fclosefail withEBADF;fread/fwrite/fseek/ftelldo not reportEBADF).Checklist
main; no other open PR implements the same functions (branch based onorigin/main; remote open-PR/issue overlap could not be fully verified here becauseghis unauthenticated)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-20T15:51:14Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T16:11:39Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
c9dc2ca642:tools/check_conventions.pyfailed.guest_standard_stream_testsbuilt cleanly.guest_standard_streams,guest_standard_streams_closed_stdout,guest_standard_streams_exclusive_stdout,guest_standard_streams_reopen_closed_stdout,guest_standard_streams_update_stdout):Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T16:14:13Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the code inspected; console behavior and the author-reported test run were not independently verified.
What I ran
Reviewed head
c9dc2ca64247d55082120f863a202275bf2c7d25. No commands or tests were run; the review reader provided the prepared diff and pinned source.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed
core/libs/prx/libc/include/FileStream.hpp,core/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/src/Formatting.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp,core/libs/prx/libc/src/StandardStreams.cpp,core/libs/tests/GuestStandardStreams.cpp, anddocs/dev/debt/changes/fix-libc-fdopen-bad-descriptor.md. The diff and review manifest were also read. No changed files were excluded; source files were read in targeted ranges, not in full.Not verified
The PS5 firmware 13.60 behavior described in the PR and the Windows test run were not independently verified. Other host platforms and actual console behavior were not tested.
To get this to a good state
Nothing is required. Optional: verify the reported behavior on PS5 firmware 13.60 and run the changed test on the pinned head.
Pull request closed