parameterize max proc id
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 28 Jul 1990 13:40:41 +0000 (05:40 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 28 Jul 1990 13:40:41 +0000 (05:40 -0800)
SCCS-vsn: sys/kern/kern_fork.c 7.20
SCCS-vsn: sys/sys/proc.h 7.20

usr/src/sys/kern/kern_fork.c
usr/src/sys/sys/proc.h

index d06476f..e515b4a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_fork.c 7.19 (Berkeley) %G%
+ *     @(#)kern_fork.c 7.20 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -122,14 +122,14 @@ newproc(isvfork)
         */
        mpid++;
 retry:
         */
        mpid++;
 retry:
-       if (mpid >= 30000) {
+       if (mpid >= PID_MAX) {
                mpid = 100;
                pidchecked = 0;
        }
        if (mpid >= pidchecked) {
                int doingzomb = 0;
 
                mpid = 100;
                pidchecked = 0;
        }
        if (mpid >= pidchecked) {
                int doingzomb = 0;
 
-               pidchecked = 30000;
+               pidchecked = PID_MAX;
                /*
                 * Scan the proc table to check whether this pid
                 * is in use.  Remember the lowest pid that's greater
                /*
                 * Scan the proc table to check whether this pid
                 * is in use.  Remember the lowest pid that's greater
index ba0c412..7f97e38 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)proc.h      7.19 (Berkeley) %G%
+ *     @(#)proc.h      7.20 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -131,6 +131,13 @@ struct kinfo_proc {
 };
 
 #ifdef KERNEL
 };
 
 #ifdef KERNEL
+/*
+ * We use process IDs <= PID_MAX;
+ * PID_MAX + 1 must also fit in a pid_t
+ * (used to represent "no process group").
+ */
+#define        PID_MAX         30000
+#define        NO_PID          30001
 #define        PIDHASH(pid)    ((pid) & pidhashmask)
 extern int pidhashmask;                /* in param.c */
 extern struct proc *pidhash[];         /* in param.c */
 #define        PIDHASH(pid)    ((pid) & pidhashmask)
 extern int pidhashmask;                /* in param.c */
 extern struct proc *pidhash[];         /* in param.c */