1 #![expect(unsafe_op_in_unsafe_fn, reason = "old code, not worth updating yet")] 2 3 use test_programs::preview1::{STDERR_FD, STDIN_FD, STDOUT_FD}; 4 test_stdio()5unsafe fn test_stdio() { 6 for fd in &[STDIN_FD, STDOUT_FD, STDERR_FD] { 7 wasip1::fd_fdstat_get(*fd).expect("fd_fdstat_get on stdio"); 8 assert_eq!(wasip1::fd_renumber(*fd, *fd + 100), Err(wasip1::ERRNO_BADF)); 9 wasip1::fd_renumber(*fd, *fd).unwrap(); 10 } 11 } 12 main()13fn main() { 14 // Run the tests. 15 unsafe { test_stdio() } 16 } 17