deno
ed8855df - fix: remove global stdio statics, clear O_NONBLOCK in child pre_exec

Commit
148 days ago
fix: remove global stdio statics, clear O_NONBLOCK in child pre_exec Architectural cleanup matching libuv's stdio fd handling strategy: 1. Remove STDIN_HANDLE/STDOUT_HANDLE/STDERR_HANDLE global statics. Deno's StdFileResourceInner now gets private dup'd fds via dup_stdio_fd() instead of cloning global Lazy<StdFile> statics. This eliminates the global ownership of fds 0/1/2. 2. Clear O_NONBLOCK on stdio fds 0-2 in child pre_exec, matching libuv's uv__process_child_init behavior. When Node's process.stdin sets O_NONBLOCK via uv_pipe_open/uv_tty_init, child processes inherit the non-blocking flag. The pre_exec hook restores blocking mode before exec so children get clean stdio. 3. Add console_size_of_stderr() to avoid depending on the removed STDERR_HANDLE static for console size detection. 4. Keep WouldBlock retry in Deno.stdin reads since O_NONBLOCK on the original fd 0 also affects dup'd fds (same file description). This is a temporary measure until Deno.stdin delegates to the libuv handle directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading