#include <pthread.h>
#include <stdio.h>
int main(){
fprintf(stdout, "SCHED_FIFO\tmin:%d\tmax:%d\n", sched_get_priority_min(SCHED_FIFO), sched_get_priority_max(SCHED_FIFO));
fprintf(stdout, "SCHED_RR\tmin:%d\tmax:%d\n", sched_get_priority_min(SCHED_RR), sched_get_priority_max(SCHED_RR));
fprintf(stdout, "SCHED_OTHER\tmin:%d\tmax:%d\n", sched_get_priority_min(SCHED_OTHER), sched_get_priority_max(SCHED_OTHER));
}
运行上面的程序,输出如下:
SCHED_FIFO min:1 max:99
SCHED_RR min:1 max:99
SCHED_OTHER min:0 max:0