Skip to content

win errno codes - #2827

Merged
ehartford merged 1 commit into
fix-2774-enum-autoreffrom
win-errno-codes
Oct 29, 2026
Merged

ehartford merged 1 commit into
fix-2774-enum-autoreffrom
win-errno-codes

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Stack created with GitHub Stacks CLI • Give Feedback 💬

#2773 made IoError.Os carry the Win32 code on Windows and its message the
system's text, but the shared runtime still wrote POSIX errnos: read_file
of a directory reported `-21` (EISDIR), which Win32 reads as
ERROR_NOT_READY, "The device is not ready (os error 21)", and a short
read `-5` (EIO), "Access is denied". The Windows backends had the same
literals: -12 (ENOMEM) on a failed allocation is ERROR_INVALID_ACCESS,
-22 (EINVAL) is ERROR_BAD_COMMAND, -5 on a short copy write and -21 on a
refused directory link.

- rt_core asks the platform for the two codes it reports
  (rt_err_is_dir, rt_err_short_read): EISDIR and EIO on POSIX and wasm
  (which already speaks POSIX numbers), ERROR_DIRECTORY_NOT_SUPPORTED
  (336) and ERROR_HANDLE_EOF (38) on Windows.
- The Windows backends name WIN_ENOMEM (8), WIN_EWRITE (29),
  WIN_ESHORTREAD (38) and WIN_EISDIR (336) beside WIN_EINVAL and use them.
- behav_fs_read_file_io_error asserts POSIX's text and codes, so it skips
  Windows; behav_fs_read_file_io_error_windows asserts Win32's, and that
  a directory never reads as "device is not ready".
- behav_process_timeout_stops_child built `-o dir/probe` and ran
  `dir/probe`: `-o` names the file exactly, and Windows runs an
  extensionless name as its `.exe`, so the probe never started (probe.out
  empty, exit nonzero on win10). Both programs take `.exe` there, as
  behav_978 and behav_build_case_output_isolation do.

Evidence (win10, cb98d27 battery): behav_fs_read_file_io_error failed at
its POSIX text; a probe printed "dir: The device is not ready (os error
21)". The process test's directory held `probe` and no `probe.exe`.
@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven battery GREEN on the stack top b99e2d1 (with run tools/battery.w, darwin-aarch64): tools/verdict.w out/battery/battery.log → rc=0 green. Windows (win10, windows-x86_64) battery on the same commit is running.

@ehartford

Copy link
Copy Markdown
Contributor Author

Windows (win10, windows-x86_64) battery on b99e2d1: behavior-tests (1998 files) and emit-c-smoke green, incl. behav_fs_read_file_io_error_windows, behav_process_timeout_stops_child and behav_1952_windows_walkers_junctions. The one red, runtime-generation-regression (and gate, which depends on it), is pre-existing on main (#2788 inventory); its cause is found (the native rt slot vs the windows_x86_64 cross slot, both selected for a native build) and is the next PR.

@ehartford
ehartford marked this pull request as ready for review October 29, 2026 21:29
@ehartford
ehartford merged commit 4c26384 into main Oct 29, 2026
@ehartford
ehartford deleted the win-errno-codes branch October 29, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant