devela::_dep::nc

Function sched_setparam

pub unsafe fn sched_setparam(pid: i32, param: &sched_param_t) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Set scheduling paramters.

§Examples

// This call always returns error because default scheduler is SCHED_NORMAL.
// We shall call sched_setscheduler() and change to realtime policy
// like SCHED_RR or SCHED_FIFO.
let sched_param = nc::sched_param_t { sched_priority: 12 };
let ret = unsafe { nc::sched_setparam(0, &sched_param) };
assert_eq!(ret, Err(nc::EINVAL));