(fd: crate::crt_fd::Borrowed<'_>)
| 9 | |
| 10 | #[cfg(not(windows))] |
| 11 | pub fn fstat(fd: crate::crt_fd::Borrowed<'_>) -> std::io::Result<StatStruct> { |
| 12 | let mut stat = core::mem::MaybeUninit::uninit(); |
| 13 | unsafe { |
| 14 | let ret = libc::fstat(fd.as_raw(), stat.as_mut_ptr()); |
| 15 | if ret == -1 { |
| 16 | Err(crate::os::errno_io_error()) |
| 17 | } else { |
| 18 | Ok(stat.assume_init()) |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | #[cfg(windows)] |
| 24 | pub mod windows { |
no test coverage detected