# 2.11BSD#431 - /usr/src/sys/sys/kern_proc.c

##### Functions

    inferior          X
    pfind             X
    pqinit            X

       1: /*
       2:  * Copyright (c) 1986 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  *
       6:  *	@(#)kern_proc.c	2.1 (2.11BSD) 1999/8/11
       7:  */
       8:
       9: #include "param.h"
      10: #include "user.h"
      11: #include "proc.h"
      12: #include "systm.h"
      13:
      14: /*
      15:  * Is p an inferior of the current process?
      16:  */
      17: inferior(p)
      18:     register struct proc *p;
      19: {
      20:
      21:     for (; p != u.u_procp; p = p->p_pptr)
      22:         if (p->p_ppid == 0)
      23:             return (0);
      24:     return (1);
      25: }
      26:
      27: struct proc *
      28: pfind(pid)
      29:     register int pid;
      30: {
      31:     register struct proc *p = pidhash[PIDHASH(pid)];
      32:
      33:     for (; p; p = p->p_hash)
      34:         if (p->p_pid == pid)
      35:             return (p);
      36:     return ((struct proc *)0);
      37: }
      38:
      39: /*
      40:  * init the process queues
      41:  */
      42: pqinit()
      43: {
      44:     register struct proc *p;
      45:
      46:     /*
      47: 	 * most procs are initially on freequeue
      48: 	 *	nb: we place them there in their "natural" order.
      49: 	 */
      50:
      51:     freeproc = NULL;
      52:     for (p = procNPROC; --p > proc; freeproc = p)
      53:         p->p_nxt = freeproc;
      54:
      55:     /*
      56: 	 * but proc[0] is special ...
      57: 	 */
      58:
      59:     allproc = p;
      60:     p->p_nxt = NULL;
      61:     p->p_prev = &allproc;
      62:
      63:     zombproc = NULL;
      64: }

#### Defined functions

inferior defined in line 17; used 3 times

- in /usr/src/sys/sys/kern_prot.c line 120
- in /usr/src/sys/sys/kern_sig.c line 50
- in /usr/src/sys/sys/tty.c line 548

pfind defined in line 27; used 11 times

- in /usr/src/sys/h/proc.h line 98
- in /usr/src/sys/sys/kern_descrip.c line 198
- in /usr/src/sys/sys/kern_prot.c line 43, 114
- in /usr/src/sys/sys/kern_resource.c line 35, 88
- in /usr/src/sys/sys/kern_sig.c line 109
- in /usr/src/sys/sys/subr_log.c line 221
- in /usr/src/sys/sys/sys_kern.c line 51
- in /usr/src/sys/sys/sys_process.c line 56
- in /usr/src/sys/sys/tty.c line 546

pqinit defined in line 42; used 1 times

- in /usr/src/sys/sys/init_main.c line 96

Last modified: 1999-08-14 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 547 |