rust/tests/fail/shims/fs/write_to_stdin.rs
2022-08-17 22:02:20 -04:00

10 lines
238 B
Rust

//@ignore-target-windows: No libc on Windows
fn main() -> std::io::Result<()> {
let bytes = b"hello";
unsafe {
libc::write(0, bytes.as_ptr() as *const libc::c_void, 5); //~ ERROR: cannot write to stdin
}
Ok(())
}