[PR #3416] [MERGED] Filesystem: Directory-related fixes #3448

Closed
opened 2026-02-27 22:03:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3416
Author: @StevenMiller123
Created: 8/14/2025
Status: Merged
Merged: 8/14/2025
Merged by: @georgemoralis

Base: mainHead: dirents-fix-again


📝 Commits (4)

  • 6949a1c Various GetDents fixes
  • 98a7974 Fstat dir stub changes
  • 3873f22 Stat dir stub changes
  • d0008c6 Merge branch 'shadps4-emu:main' into dirents-fix-again

📊 Changes

1 file changed (+40 additions, -29 deletions)

View changed files

📝 src/core/libraries/kernel/file_system.cpp (+40 -29)

📄 Description

After running some hardware tests on my PS4, I've found several discrepancies between our behavior and an actual PS4. This PR resolves several bugs I've encountered.

  • GetDents (and all reliant functions) now have correct parameters and return types. These are based on what FreeBSD documents for these functions.
  • GetDents now returns all entries that will fit inside nbytes, rather than returning one entry per call.
  • Changed the returned blksize, blocks, and size of directories to match what I've seen across several fstat tests. /app0, folders inside /app0, and /system/common/lib on real hardware all return size = 65536, blocks = 128, and blksize = 65536, so I've updated our stub for stat and fstat to return those constants instead. /temp0 appears to return smaller values, not sure where they come from though.

With all these changes in effect, all versions of Kingdom Come Deliverance: Royal Edition (CUSA15436) progress further, but still crash at nothing due to access violations occuring during sharp tracking.
CUSA15436.log


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3416 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 8/14/2025 **Status:** ✅ Merged **Merged:** 8/14/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `dirents-fix-again` --- ### 📝 Commits (4) - [`6949a1c`](https://github.com/shadps4-emu/shadPS4/commit/6949a1cf81fe41d3aa2980d2ef8590cb3c41bac2) Various GetDents fixes - [`98a7974`](https://github.com/shadps4-emu/shadPS4/commit/98a79747dfff44e78115d7b699349b26398a69f3) Fstat dir stub changes - [`3873f22`](https://github.com/shadps4-emu/shadPS4/commit/3873f22f995141d7370c15ebeb6ff5a6c8fe0ca1) Stat dir stub changes - [`d0008c6`](https://github.com/shadps4-emu/shadPS4/commit/d0008c6c7af4cc678fa53c03d551c8f4167efbae) Merge branch 'shadps4-emu:main' into dirents-fix-again ### 📊 Changes **1 file changed** (+40 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/file_system.cpp` (+40 -29) </details> ### 📄 Description After running some hardware tests on my PS4, I've found several discrepancies between our behavior and an actual PS4. This PR resolves several bugs I've encountered. - GetDents (and all reliant functions) now have correct parameters and return types. These are based on what FreeBSD documents for these functions. - GetDents now returns all entries that will fit inside nbytes, rather than returning one entry per call. - Changed the returned blksize, blocks, and size of directories to match what I've seen across several fstat tests. /app0, folders inside /app0, and /system/common/lib on real hardware all return `size = 65536`, `blocks = 128`, and `blksize = 65536`, so I've updated our stub for stat and fstat to return those constants instead. /temp0 appears to return smaller values, not sure where they come from though. With all these changes in effect, all versions of Kingdom Come Deliverance: Royal Edition (CUSA15436) progress further, but still crash at nothing due to access violations occuring during sharp tracking. [CUSA15436.log](https://github.com/user-attachments/files/21765075/CUSA15436.log) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3448
No description provided.