mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-31 06:51:04 +00:00
Fixed wasi isatty tests when being generated
This commit is contained in:
parent
62e1526037
commit
c287170166
@ -1,3 +1,5 @@
|
|||||||
|
// We don't have access to libc, so we just use isatty
|
||||||
|
// as an external function
|
||||||
// use libc::isatty;
|
// use libc::isatty;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -5,7 +7,14 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("stdin: {}", unsafe { isatty(0) });
|
#[cfg(target = "wasi")] {
|
||||||
println!("stdout: {}", unsafe { isatty(1) });
|
println!("stdin: {}", unsafe { isatty(0) });
|
||||||
println!("stderr: {}", unsafe { isatty(2) });
|
println!("stdout: {}", unsafe { isatty(1) });
|
||||||
|
println!("stderr: {}", unsafe { isatty(2) });
|
||||||
|
}
|
||||||
|
#[cfg(not(target = "wasi"))] {
|
||||||
|
println!("stdin: 1");
|
||||||
|
println!("stdout: 1");
|
||||||
|
println!("stderr: 1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user