Function nc::sched_setparam

source ·
pub unsafe fn sched_setparam(
    pid: pid_t,
    param: &sched_param_t
) -> Result<(), Errno>
Expand description

Set scheduling paramters.

§Example

// 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));