Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force usage of a worker thread for stdin on all platforms (#7058)
This commit is a follow-up to #6833 to remove the `unix` module for handling stdio which sets stdin to nonblocking mode. I've just now discovered that on macOS at least configuring `O_NONBLOCK` for stdin affects the stdout/stderr descriptors too. This program for example will panic: fn main() { unsafe { let r = libc::fcntl( libc::STDIN_FILENO, libc::F_SETFL, libc::fcntl(libc::STDIN_FILENO, libc::F_GETFL) | libc::O_NONBLOCK, ); assert_eq!(r, 0); } loop { println!("hello"); } } It was originally assumed that updating the flags for stdin wouldn't affect anything else except Wasmtime, but because this looks to not be the case this commit removes the logic of registering stdin raw with Tokio and instead unconditionally using the worker thread solution which should work in all situations.
- Loading branch information