fix(libkernel): truncate with O_RDONLY on Windows #5112
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5112"
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 MarcZX10 on 2026-10-13T12:02:02Z.
Closes #5095
What
Carry the three commits from David Samir's ready fix branch, preserving their original commit authorship. On Windows, opening an existing file with
O_RDONLY | O_TRUNCcurrently passesGENERIC_READwithTRUNCATE_EXISTING, whichCreateFileWrejects. For this flag combination, open with read/write access so truncation succeeds, then duplicate the handle with read-only access and close the original. Other flag combinations are unchanged.Add
TestReadOnlyTruncatingOpentoguest_filesystemto verify truncation through another open descriptor, read-only behavior of the returned descriptor, missing-file and directory errors, andEACCESfor a read-only file. Record the remaining Windows host sharing limitation in technical debt.Tested
guest_filesystem_tests, and ranguest_filesystemthree times; all three passed.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.ctest --parallel 4passed 1051/1051. That Windows run predates this rebase and was not repeated here.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by likecrank-dotcom on 2026-10-13T13:57:07Z.
Independent Windows validation of the current PR head
8ac4ae7a2a735872f5bc47393083b3461c2e863a(Windows native, WinLibs MinGW GCC 15.2.0, CMake 4.4.4):guest_filesystem_testsand the adjacent truncate, dup, file-vector, fcntl, and file-lock test executables.guest_filesystempassed 5/5 with--repeat until-fail:5.guest_filesystem,guest_truncate,guest_dup,guest_file_vector,guest_kernel_fcntl, and all sixguest_file_lock_*cases passed 11/11, each repeated three times (33 executions).tools/check_conventions.py --base origin/main --head HEADandgit diff --check origin/main...HEADpassed.This was a targeted test build only; no full native build or title runtime was run. No changes were made to the PR branch.
AI-assisted verification: OpenAI Codex. The PR author remains responsible for the submitted implementation.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T15:18:53Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/tests/GuestFilesystem.cppL219, L222Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:33:19Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed