fix(libkernel): report EISDIR for path truncation #2086
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2086"
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 STUPIDCONTEM on 2026-10-09T07:33:48Z.
Evidence review (2026-10-09)
Game/title evidence has not been established. Validation below is host regression/build evidence only; it does not establish title compatibility. Older checked items and test results describe their stated revisions, not current merge readiness.
Game/title ID: none verified. No PS5 title execution is claimed.
What
Path-based sceKernelTruncate now returns encoded EISDIR for an existing directory instead of collapsing the resize failure to EIO. On Windows, filesystem resize reports a generic permission error for this case, so recognize a directory only after a successful status query. Keep the existing negative-length check first and leave other resize-error mappings unchanged.
The behavior and negative-length precedence are verified in FreeBSD stable/11 kern_truncate: negative lengths fail before path lookup; a resolved directory is rejected with EISDIR before ordinary write checks. This is a narrow directory classification fix, not a complete rewrite of path-truncation error handling or host filesystem race semantics.
Tested
Windows 10 Pro 19045, WinLibs GCC 15.2.0 UCRT posix SEH r7, Release, BUILD_TESTING=ON; independent branch from main
f145139676.No Linux or title run was performed for this branch. #2041 fixes descriptor-based ftruncate and uses a different path; #2001 removes write-watch recording in the same function but does not implement this directory-error behavior. No open PR duplicating this change was found.
Checklist
Pull request closed