// sched_setscheduler 使用の無限ループ実験プログラム #include #include #include #include int main(void) { int i,j; struct sched_param sp; time_t st,now; sp.sched_priority=80; sched_setscheduler(0,SCHED_FIFO,&sp); printf("max,min=%d,%d\n", sched_get_priority_max(SCHED_FIFO), sched_get_priority_min(SCHED_FIFO)); printf("schedule policy: %d\n",sched_getscheduler(0)); st=time(NULL); while(1) { now=time(NULL); if(now>st+10) break; } return 0; }