1 // ignore-windows: No libc on Windows
2 // compile-flags: -Zmiri-disable-isolation
4 #![feature(rustc_private)]
8 use std::env::temp_dir;
9 use std::fs::{File, remove_file};
11 use std::os::unix::io::AsRawFd;
14 let path = temp_dir().join("miri_test_libc.txt");
15 // Cleanup before test
16 remove_file(&path).ok();
18 // Set up an open file
19 let mut file = File::create(&path).unwrap();
20 let bytes = b"Hello, World!\n";
21 file.write(bytes).unwrap();
23 // Test calling posix_fadvise on a file.
29 libc::POSIX_FADV_DONTNEED,
33 remove_file(&path).unwrap();
34 assert_eq!(result, 0);