Skip to content

docs(libc): record fopen and freopen of directories as measured on a PS5 - #10251

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
orezraey:docs/libc-fopen-directory-measured-ps5
Oct 27, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
orezraey:docs/libc-fopen-directory-measured-ps5

Conversation

@orezraey

@orezraey orezraey commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What

fopen and freopen on directories, and the mode strings, measured on a retail PS5 (firmware 13.60) through libSceLibcInternal.sprx from a payload process. The source and console log are in this gist (pfopen).

The debt entry said what the console's filesystems return for a directory stream was unverified. The console:

  • opens a directory in a read mode (r, rb, rw), and fread returns its raw directory blocks for /data and /system, or fails with EIO and sets the error indicator for /;
  • lets freopen reopen a stream onto a directory in a read mode.

AnyPS5 keeps failing a directory read with EISDIR, since the host's directory blocks are not the console's, and on Windows freopen onto a directory still fails with EACCES; the entry now says both. The other answers already matched and gain tests: EEXIST for wx on an existing file, EINVAL for an unknown or empty mode, rw read as r. EISDIR for a directory in a write or update mode and ENOENT for a missing file were already tested.

Tested

Windows 11, MinGW (winlibs).

  • guest_filesystem checks wx, the invalid modes and rw, and passes three runs in a row.
  • tools/check_conventions.py passes.
  • tools/pr_overlap.py reports only shared files.

Checklist

orezraey and others added 2 commits October 23, 2026 12:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 23, 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 docs/dev/debt/libc.md
PR 6713 docs/dev/debt/libc.md
PR 7081 docs/dev/debt/libc.md
PR 7386 docs/dev/debt/libc.md
PR 7447 docs/dev/debt/libc.md
PR 7648 docs/dev/debt/libc.md
PR 7715 docs/dev/debt/libc.md
PR 8150 docs/dev/debt/libc.md
PR 9371 core/libs/tests/GuestFilesystem.cpp
docs/dev/debt/libc.md
PR 9447 docs/dev/debt/libc.md
PR 9473 core/libs/tests/GuestFilesystem.cpp
PR 9526 docs/dev/debt/libc.md
PR 9929 docs/dev/debt/libc.md
PR 9947 core/libs/tests/GuestFilesystem.cpp
PR 10113 docs/dev/debt/libc.md
PR 10226 docs/dev/debt/libc.md
PR 10319 core/libs/tests/GuestFilesystem.cpp
PR 10324 docs/dev/debt/libc.md
PR 10345 docs/dev/debt/libc.md
PR 10749 docs/dev/debt/libc.md
PR 11270 docs/dev/debt/libc.md
PR 11332 docs/dev/debt/libc.md
PR 11341 docs/dev/debt/libc.md

@github-actions github-actions Bot added the docs label Oct 23, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 23, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@orezraey Please keep the final checklist value to yes, removing the parenthetical suffix.

@orezraey

Copy link
Copy Markdown
Contributor Author

The AI-assisted line now reads yes.

@orezraey

Copy link
Copy Markdown
Contributor Author

@rooklz @Retr0G28: #9763 and #10433 change the same lines as this PR in docs/dev/debt/libc.md (git merge-tree of both heads over current main conflicts there). I propose they land first; I will then merge main into this branch, keeping both sides' behaviour, and rerun its tests. Depends on now lists them (merge order only).

@babyhuey

Copy link
Copy Markdown
Contributor

Linux run of this head 85caaefe6d4, merged onto main a7a2eece499 (clean merge, local only), with the selection CI's skipped Linux product job uses: anyps5-build CI image (Ubuntu 24.04, GCC 13, Release, BUILD_TESTING=ON), lavapipe with ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx. The tree was configured fresh after the merge, then select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --timeout 120.

  • Selected 354 tests: all 354 pass. No new failures.

AI-assisted: yes (Claude Code)

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@orezraey Please ignore my earlier point about the AI-assisted line; that line is yours to word as you like, so feel free to put the tool name back.

@oneandonlydean
oneandonlydean merged commit 2f0a007 into boykopovar:main Oct 27, 2026
14 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