• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // `is_read_write` is not yet implemented on Windows. And `ioctl_fionread`
2 // on Windows doesn't work on files.
3 #[cfg(not(windows))]
4 #[test]
test_ioctls()5 fn test_ioctls() {
6     let file = std::fs::File::open("Cargo.toml").unwrap();
7 
8     #[cfg(all(feature = "fs", feature = "net"))]
9     assert_eq!(rustix::io::is_read_write(&file).unwrap(), (true, false));
10 
11     assert_eq!(
12         rustix::io::ioctl_fionread(&file).unwrap(),
13         file.metadata().unwrap().len()
14     );
15 }
16