about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs
blob: 81e5034f1174049892e5b7fef71f4c1f0195b273 (plain)
1
2
3
4
5
6
7
8
9
//@ignore-target: windows # No libc IO 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(())
}