host_posix: file calls report host errors as Windows does #132
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!132
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-132"
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?
@Olima34 on GitHub · 2026-11-26 18:21 UTC · original
Olima34:fix/files-too-many-open-files→main· +80 −17 · 4 files · 1 commits · merged 2026-11-26 19:01 UTChost_posix::files::win32_error, which backsCreateFileW, the attribute, delete, directory and find calls infiles.rs, plusMoveFileExWandCopyFile2insystem.rs, returnedERROR_ACCESS_DENIEDfor every host error it did not name: running out of file descriptors, a full disk, a cross-device move, and so on.What.
crate::win32_errors::code(&io::Error) -> Option<u32>: one table, the UCRT's_dosmaperrread backwards.ErrorKind, so macOS's ENOTEMPTY (66) and Linux's (39) both map.Nonefor the rest, so each caller keeps its own fallback.files::win32_erroruses it, keepsERROR_ACCESS_DENIEDas the fallback, and keepsERROR_PATH_NOT_FOUNDwhen the parent folder is missing.CreateDirectoryWstill maps AlreadyExists toERROR_ALREADY_EXISTSitself.shortcut:note. Once this and #130 have both landed,dstorage::from_win32can share the table too. I kept them separate so the two PRs don't conflict.Tests.
win32_errors::host_errors_have_their_win32_codeschecks every row; EIO givesNone.files::host_errors_reach_file_calls_as_windows_reports_themchecks FILE vs PATH not found, EMFILE→4, ENOTEMPTY→145, EEXIST→80, and EIO→5. On main it fails with "EMFILE: left 5 right 4".cargo test -p victory-hle --target x86_64-apple-darwin --lib(250), Windows clippy andcargo xtask policypass. No test or probe asserted the old codes.(This PR first carried only the EMFILE/ENFILE arm; it now carries the whole table.)
files: running out of file descriptors is ERROR_TOO_MANY_OPEN_FILESto host_posix: file calls report host errors as Windows does0fb9c44556to69baf0ade5@LakshanSivakumar on GitHub · 2026-11-26 18:56 UTC · original · approved these changes
Reviewed and tested together with the other open PRs on main (macOS x86_64 tests for shader, hle, loader and gpu, the setup shell tests, and Windows clippy). Thanks!