$NetBSD: patch-af,v 1.2 2005/05/29 14:38:33 wiz Exp $

--- glunix/src/sched/csched.cc.orig	1996-07-26 00:01:27.000000000 +0200
+++ glunix/src/sched/csched.cc
@@ -84,9 +84,16 @@
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+
+#ifdef __NetBSD__
+#include <sys/time.h>
+#include <sys/resource.h>
+typedef short pri_t;
+#else
 #include <sys/priocntl.h>
 #include <sys/rtpriocntl.h>
 #include <sys/tspriocntl.h>
+#endif
 
 #include "glib/types.h"
 #include "cdebug.h"
@@ -102,6 +109,7 @@
  *
  * Side effects:
  *****************************************************************************/
+#ifndef __NetBSD__
 static short
 Sched_GetMaxPriority(void)
 {
@@ -120,6 +128,7 @@ Sched_GetMaxPriority(void)
     D9("%d\n", maxPriority);
     return maxPriority;
 }
+#endif
 
 /******************************************************************************
  * Sched_GetMyCid --
@@ -131,6 +140,9 @@ Sched_GetMaxPriority(void)
  *
  * Side effects:
  *****************************************************************************/
+#ifdef __NetBSD__
+
+#else
 static id_t
 Sched_GetMyCid(void)
 {
@@ -152,7 +164,7 @@ Sched_GetMyCid(void)
     return myCid;
     
 }
-
+#endif
 /******************************************************************************
  * Sched_SetSchedPriority --
  *    Set the priority of the target pid to be higher than normal processes
@@ -168,8 +180,14 @@ Sched_GetMyCid(void)
  *    The target processes UNIX scheduling priority is increased.
  *****************************************************************************/
 void
-Sched_SetSchedPriority(pid_t targPid, pri_t offset)
+Sched_SetSchedPriority(pid_t targPid, short offset)
 {
+#ifdef __NetBSD__
+
+  setpriority(PRIO_PROCESS, targPid, PRIO_MIN+offset);
+  return;
+
+#else
     pcparms_t  parms;
     short      maxPriority;
 
@@ -182,6 +200,7 @@ Sched_SetSchedPriority(pid_t targPid, pr
 	DE("priocntl: %s\n", strerror(errno));
     }
     return;
+#endif
 }
 
 /*****************************************************************************/
