MCPcopy Index your code
hub / github.com/RustPython/RustPython / fstat

Function fstat

crates/common/src/fileutils.rs:11–21  ·  view source on GitHub ↗
(fd: crate::crt_fd::Borrowed<'_>)

Source from the content-addressed store, hash-verified

9
10#[cfg(not(windows))]
11pub 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)]
24pub mod windows {

Callers 5

py_newMethod · 0.85
sizeMethod · 0.85
set_wakeup_fdFunction · 0.85
initMethod · 0.85
stat_innerFunction · 0.85

Calls 9

errno_io_errorFunction · 0.85
as_handleFunction · 0.85
GetFileTypeFunction · 0.85
as_mut_ptrMethod · 0.80
is_errMethod · 0.80
attribute_data_to_statFunction · 0.70
ErrClass · 0.50
SomeClass · 0.50
as_rawMethod · 0.45

Tested by

no test coverage detected