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

Function sched_setscheduler

crates/vm/src/stdlib/posix.rs:2861–2869  ·  view source on GitHub ↗
(args: SchedSetschedulerArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

2859 #[cfg(not(target_env = "musl"))]
2860 #[pyfunction]
2861 fn sched_setscheduler(args: SchedSetschedulerArgs, vm: &VirtualMachine) -> PyResult<i32> {
2862 let libc_sched_param = convert_sched_param(&args.sched_param, vm)?;
2863 let policy = unsafe { libc::sched_setscheduler(args.pid, args.policy, &libc_sched_param) };
2864 if policy == -1 {
2865 Err(vm.new_last_errno_error())
2866 } else {
2867 Ok(policy)
2868 }
2869 }
2870
2871 #[pyfunction]
2872 fn sched_getparam(pid: libc::pid_t, vm: &VirtualMachine) -> PyResult<PyTupleRef> {

Callers

nothing calls this directly

Calls 3

convert_sched_paramFunction · 0.85
new_last_errno_errorMethod · 0.80
ErrClass · 0.50

Tested by

no test coverage detected