fix(libkernel): allow delete sharing for open Windows files #3677
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3677"
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-11T15:13:04Z.
What
On Windows,
sceKernelOpencurrently uses_wopenwithout delete sharing. As a result, a guest cannot unlink an open file or rename an open source file, although those operations work on the Linux build and match the documented FreeBSD behavior. Open descriptors should continue to access the original file after its name is removed or moved, while a new file can take the old name.This carries David Samir's commit from issue #3316, with the original commit author preserved. I rebased it onto current
mainand moved the added regression block earlier inGuestFilesystem.cppto avoid the active test additions near the end of that file.Open PR #2144 separately changes Windows scalar file error handling in
Open.cpp; it does not implement delete sharing. The PRs touch the same file and should be rechecked/rebased if either merges first.Tested
guest_filesystempasses 5/5, 3,276_wopencomparison cases agree with the replacement, 50,000 open/close cycles retain the same timing, and a multithreaded create/write/unlink/recreate workload passes. Their full suite reports 770 passed and 5 skipped. These runs were on an earlier base and were not repeated here.guest_filesystempassing 3/3 on the carried change. I did not rerun that target locally.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no other open PR implements the same behaviorNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Fixes #3316
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:49:22Z.
Checked the
CreateFileWreplacement against the old_wopenbehaviour: access mode, CREAT/EXCL/TRUNC dispositions, APPEND/BINARY flags passed to_open_osfhandle, read-only attribute frommode, inheritable handle, handle closed if_open_osfhandlefails.guest_filesystempasses on Linux and the conventions check is green. The Windows behaviour rests on the Windows 11 runs reported in #3316 (not reproducible here); merging.