9.70 get/set_scheduler

#define SCHED_OTHER 0
#define SCHED_FIFO  1
#define SCHED_RR    2
#define SCHED_IDLE  5

struct sched_param {
	int32_t sched_priority;
};

int sched_getscheduler(pid_t pid);
int sched_setscheduler(pid_t pid, int policy, struct sched_param *param);

This syscalls get and set scheduler details for the passed process. pid can be either a PID or 0 for the caller.

param’s priority is only used for the real time policies, and is delimited by the values returned at see get_min/max_priority.

sched_getscheduler returns the scheduler or -1 on failure, sched_setscheduler returns 0 on success or -1 on failure.