teach wasi about stderr

This commit is contained in:
Brendan Hansknecht 2024-12-11 16:39:38 -08:00
parent 0a573ca557
commit 4d7a6f1792
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -122,8 +122,8 @@ impl<'a> WasiDispatcher<'a> {
let stat_mut_ptr = arguments[1].expect_i32().unwrap() as usize;
match fd {
1 => {
// Tell WASI that stdout is a tty (no seek or tell)
1 | 2 => {
// Tell WASI that stdout and stderr are a tty (no seek or tell)
// https://github.com/WebAssembly/wasi-libc/blob/659ff414560721b1660a19685110e484a081c3d4/libc-bottom-half/sources/isatty.c
// *Not* a tty if:
// (statbuf.fs_filetype != __WASI_FILETYPE_CHARACTER_DEVICE ||