$NetBSD: patch-ak,v 1.2 2001/06/29 18:39:03 wiz Exp $ --- new-src/scheduler.c.orig Sat Dec 12 12:16:30 1998 +++ new-src/scheduler.c @@ -3,25 +3,28 @@ * - * Written by Fred Floberg - * */ -#include + +#include +#include #include -#include "cs.h" + +#define HIGH_PRIORITY -20 + void setscheduler(void) { - struct sched_param sched_param; extern int scheduler_priority; - if(!scheduler_priority) return; /* Check commandline option */ - if (sched_getparam(0, &sched_param)<0) { - err_printf("Scheduler getparam failed...\n"); - return; - } - sched_param.sched_priority = sched_get_priority_max(SCHED_RR); - if (!sched_setscheduler(0, SCHED_RR, &sched_param)) { - err_printf("Scheduler set to Round Robin with priority %i...\n", sched_param.sched_priority); - fflush(stderr); - return; - } - err_printf("!!!Scheduler set to Round Robin with priority %i FAILED!!!\n", sched_param.sched_priority); + if (scheduler_priority == 0) + return; + + if (setpriority(PRIO_PROCESS, 0, HIGH_PRIORITY) == 0) { + err_printf("Scheduler set to priority %i...\n", + HIGH_PRIORITY); + fflush(stderr); + return; + } + + err_printf("Scheduler set to priority %i FAILED!!!\n", + HIGH_PRIORITY); + fflush(stderr); + return; }