The following program does not panic on Hermit, although it should return EBADF on read:
use std::fs::File;
use std::io::{Read, Write};
#[cfg(target_os = "hermit")]
use hermit as _;
const BUF_SIZE: usize = 8 * 1024;
fn main() {
let mut file = File::create("/tmp/hello.txt").unwrap();
let mut buf = vec![0; BUF_SIZE];
file.read(&mut buf).unwrap();
}
The following program does not panic on Hermit, although it should return
EBADFonread: