cc [ flag ... ] file ... -lposix4 [ library ... ]
#include <sched.h>
int sched_get_priority_max(int policy);
int sched_get_priority_min(int policy);
int sched_rr_get_interval(pid_t pid, struct timespec *interval);
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
sched_rr_get_interval() updates the timespec structure referenced by interval to contain the current execution time limit (i.e., time quantum) for the process specified by pid under the SCHED_RR policy. After that time limit expires, when another process at the same priority is ready to execute, a scheduling decision will be made. If pid is zero, the current execution time limit for the calling process is stored in interval.
The value of policy must be one of the scheduling
policy values defined in <sched.h>:
SCHED_FIFO,
SCHED_RR,
or SCHED_OTHER.
If successful, sched_rr_get_interval() returns 0.
If unsuccessful, these functions return -1, and set errno to indicate the error condition.