sched

Prototypes

Details

public intsched_get_priority_max(int policy)

This function gets the maximum priority for policy.

Returns

Zero on success or -1 with errno (see Errno) set to:

  • EINVAL: policy is not SCHED_RR, SCHED_FIFO, or SCHED_OTHER

public intsched_get_priority_min(int policy)

This function gets the minimum priority for policy.

Returns

Zero on success or -1 with errno (see Errno) set to:

  • EINVAL: policy is not SCHED_RR, SCHED_FIFO, or SCHED_OTHER

public intsched_getparam(pid_t pid,struct sched_param * param)

This function gets the scheduling parameter (priority) for pid.

Returns

Zero on success or -1 with errno (see Errno) set to:

  • EINVAL: policy is not SCHED_RR, SCHED_FIFO, or SCHED_OTHER

  • ESRCH: pid is not a valid process


public intsched_getscheduler(pid_t pid)

This function gets the scheduling policy.

Returns

The scheduling policy on success or -1 with errno (see Errno) set to:

  • ESRCH: pid is not a valid process

public intsched_rr_get_interval(pid_t pid,struct timespec * ts)

This function gets the round robin interval for pid.

Returns

Zero on success or -1 with errno (see Errno) set to:

  • EINVAL: ts is NULL

  • ESRCH: pid is not a valid process


public intsched_setparam(pid_t pid,const struct sched_param * param)

This function sets the process's scheduling paramater (priority).

Returns

Zero on success or -1 with errno (see Errno) set to:

  • ESRCH: pid is not a valid process

  • EPERM: the calling process does not have permission to change the scheduling parameters


public intsched_setscheduler(pid_t pid,int policy,const struct sched_param * param)

This function sets the scheduler policy and parameter (priority) for the process.

Returns

Zero on success or -1 with errno (see Errno) set to:

  • EINVAL: policy is not SCHED_RR, SCHED_FIFO, or SCHED_OTHER

  • EPERM: the calling process does not have permission to change the scheduling parameters

  • ESRCH: pid is not a valid process


public intsched_yield()

This function causes the calling thread to yield the processor. The context is switched to the next active task. If no tasks are active, the CPU idles.

Returns

Zero