$NetBSD: patch-ab,v 1.1.1.1 2000/07/25 12:44:34 wulf Exp $

--- interp/baiutils.c.orig	1999-08-31 18:19:18.000000000 +0200
+++ interp/baiutils.c
@@ -1,6 +1,7 @@
  /* BenAri Concurrent PCODE Interpreter Utilities */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 
@@ -10,12 +11,7 @@
 #include "random.h"
 #include "bainterp.h"
 
-extern int fprintf(FILE*,const char*,...);
-extern int fclose(FILE*);
-extern int printf(const char*,...);
-extern int atoi(char*);
 extern int build_cbtab();
-extern int sscanf(const char*, const char*,...);
 
 FNAME_STRING interp_pname;
 
@@ -171,8 +167,8 @@ void chooseproc()
 
    d = PMAXP1;
    suspended = active = 0;
-   look = random(PMAXP1);
-   add = 1 + random(PMAX); /* 1 <= add <= PMAXP1 */
+   look = __random(PMAXP1);
+   add = 1 + __random(PMAX); /* 1 <= add <= PMAXP1 */
    while ( ((!ptab[look].active) || (ptab[look].suspend>=0) ||
             (ptab[look].tabix < 0)) && (d >= 0) ){
 /* keep looking until a called process that is active and not
@@ -189,7 +185,7 @@ void chooseproc()
       ps = deadlock;
    }
    else {
-      stepcount = random(STEPMAXP1);
+      stepcount = __random(STEPMAXP1);
       if (ptab[curpr].atomic){
          if (ptab[curpr].suspend >= 0) {
             ps = deadlock;
