alexcrichton opened PR #7058 from alexcrichton:stdin-always-worker
to bytecodealliance:main
:
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 configuringO_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.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-core-reviewers for a review on PR #7058.
alexcrichton requested fitzgen for a review on PR #7058.
pchickey submitted PR review.
pchickey merged PR #7058.
Last updated: Dec 23 2024 at 12:05 UTC