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

Function sysconf

crates/vm/src/stdlib/posix.rs:2599–2606  ·  view source on GitHub ↗
(name: SysconfName, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

2597
2598 #[pyfunction]
2599 fn sysconf(name: SysconfName, vm: &VirtualMachine) -> PyResult<libc::c_long> {
2600 crate::common::os::set_errno(0);
2601 let r = unsafe { libc::sysconf(name.0) };
2602 if r == -1 && crate::common::os::get_errno() != 0 {
2603 return Err(vm.new_last_errno_error());
2604 }
2605 Ok(r)
2606 }
2607
2608 #[pyattr]
2609 fn sysconf_names(vm: &VirtualMachine) -> PyDictRef {

Callers 4

extend_classMethod · 0.85
close_fds_brute_forceFunction · 0.85
get_process_timeFunction · 0.85
timesFunction · 0.85

Calls 4

new_last_errno_errorMethod · 0.80
set_errnoFunction · 0.70
get_errnoFunction · 0.70
ErrClass · 0.50

Tested by

no test coverage detected