cellFs: Readdir writes the 258 byte dirent ABI and real CellOS errors - #85
Open
canersaka wants to merge 2 commits into
Open
cellFs: Readdir writes the 258 byte dirent ABI and real CellOS errors#85canersaka wants to merge 2 commits into
canersaka wants to merge 2 commits into
Conversation
canersaka
marked this pull request as ready for review
July 25, 2026 05:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cellFsReaddir was writing CellFsDirectoryEntry, the separate stat-carrying shape used by cellFsGetDirectoryEntries, into an API whose output is the compact CellFsDirent
{ d_type, d_namlen, d_name[256] }. It also returned nread=1 instead of the number of bytes written. A guest using the real 258-byte allocation had the wrong fields at every offset and could have the larger host-side structure written past its buffer.This gives Readdir its real packed 258-byte shape on both Win32 and POSIX, fills d_type and d_namlen, and reports 0x102 in nread. The prerequisite commit also corrects the generic CellOS error table from 0x8001001A through 0x8001003E; the old table had EBADF at 0x80010025 and then aliased EFSSPECIFIC onto the same value, so cellFs returned numbers real guest code would not recognize. cellFsGetDirectoryEntries and its stat-carrying structure are deliberately left alone.
Verified: ps3recomp_runtime builds clean. CellFsDirent has a compile-time size assertion of 258 bytes, both host paths write that exact shape, EOF still returns nread=0, and the generic error values were checked against RPCS3's ErrorCodes.h as an ABI oracle.