# 2.11BSD#431 - /usr/src/bin/csh/sh.proc.h

##### Variables

    pcurrent          X
    pcurrjob          X
    pholdjob          X
    pmaxindex         X
    pprevious         X
    proclist          X

##### Macros

    AMPERSAND         X
    AREASON           X
    FANCY             X
    JOBDIR            X
    NAME              X
    NUMBER            X
    PAEXITED          X
    PALLSTATES        X
    PAWAITED          X
    PDIAG             X
    PDUMPED           X
    PFOREGND          X
    PINTERRUPTED      X
    PMAXLEN           X
    PNEEDNOTE         X
    PNEXITED          X
    PNOTIFY           X
    PNULL             X
    PPOU              X
    PPTIME            X
    PREPORTED         X
    PRUNNING          X
    PSIGNALED         X
    PSTOPPED          X
    PTIME             X
    REASON            X
    SHELLDIR          X

##### struct's

    process           X

       1: /*
       2:  * Copyright (c) 1980 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:  *	@(#)sh.proc.h	5.2 (Berkeley) 6/6/85
       7:  */
       8:
       9: /*
      10:  * C shell - process structure declarations
      11:  */
      12:
      13: /*
      14:  * Structure for each process the shell knows about:
      15:  *	allocated and filled by pcreate.
      16:  *	flushed by pflush; freeing always happens at top level
      17:  *	    so the interrupt level has less to worry about.
      18:  *	processes are related to "friends" when in a pipeline;
      19:  *	    p_friends links makes a circular list of such jobs
      20:  */
      21: struct process  {
      22:     struct  process *p_next;    /* next in global "proclist" */
      23:     struct  process *p_friends; /* next in job list (or self) */
      24:     struct  directory *p_cwd;   /* cwd of the job (only in head) */
      25:     short   unsigned p_flags;   /* various job status flags */
      26:     char    p_reason;       /* reason for entering this state */
      27:     char    p_index;        /* shorthand job index */
      28:     int p_pid;
      29:     int p_jobid;        /* pid of job leader */
      30:     /* if a job is stopped/background p_jobid gives its pgrp */
      31:     struct  timeval p_btime;    /* begin time */
      32:     struct  timeval p_etime;    /* end time */
      33:     struct  rusage p_rusage;
      34:     char    *p_command;     /* first PMAXLEN chars of command */
      35: };
      36:
      37: /* flag values for p_flags */
      38: #define PRUNNING    (1<<0)      /* running */
      39: #define PSTOPPED    (1<<1)      /* stopped */
      40: #define PNEXITED    (1<<2)      /* normally exited */
      41: #define PAEXITED    (1<<3)      /* abnormally exited */
      42: #define PSIGNALED   (1<<4)      /* terminated by a signal != SIGINT */
      43:
      44: #define PALLSTATES  (PRUNNING|PSTOPPED|PNEXITED|PAEXITED|PSIGNALED|PINTERRUPTED)
      45: #define PNOTIFY     (1<<5)      /* notify async when done */
      46: #define PTIME       (1<<6)      /* job times should be printed */
      47: #define PAWAITED    (1<<7)      /* top level is waiting for it */
      48: #define PFOREGND    (1<<8)      /* started in shells pgrp */
      49: #define PDUMPED     (1<<9)      /* process dumped core */
      50: #define PDIAG       (1<<10)     /* diagnostic output also piped out */
      51: #define PPOU        (1<<11)     /* piped output */
      52: #define PREPORTED   (1<<12)     /* status has been reported */
      53: #define PINTERRUPTED    (1<<13)     /* job stopped via interrupt signal */
      54: #define PPTIME      (1<<14)     /* time individual process */
      55: #define PNEEDNOTE   (1<<15)     /* notify as soon as practical */
      56:
      57: #define PNULL       (struct process *)0
      58: #define PMAXLEN     80
      59:
      60: /* defines for arguments to pprint */
      61: #define NUMBER      01
      62: #define NAME        02
      63: #define REASON      04
      64: #define AMPERSAND   010
      65: #define FANCY       020
      66: #define SHELLDIR    040     /* print shell's dir if not the same */
      67: #define JOBDIR      0100        /* print job's dir if not the same */
      68: #define AREASON     0200
      69:
      70: struct  process proclist;       /* list head of all processes */
      71: bool    pnoprocesses;           /* pchild found nothing to wait for */
      72:
      73: struct  process *pholdjob;      /* one level stack of current jobs */
      74:
      75: struct  process *pcurrjob;      /* current job */
      76: struct  process *pcurrent;      /* current job in table */
      77: struct  process *pprevious;     /* previous job in table */
      78:
      79: short   pmaxindex;          /* current maximum job index */
      80:
      81: int psigint();
      82: struct  process *pgetcurr();
      83: struct  process *plookup();
      84: struct  process *pfind();

#### Defined variables

pcurrent defined in line 76; used 13 times

- in /usr/src/bin/csh/sh.proc.c line 105-107(4), 320-325(3), 394-395(2), 561, 927-929(2), 981

pcurrjob defined in line 75; used 22 times

- in /usr/src/bin/csh/sh.proc.c line 180, 296-297(2), 362-373(7), 488-489(2), 499, 511-512(3), 523, 1048-1050(3)
- in /usr/src/bin/csh/sh.sem.c line 176(2)

pholdjob defined in line 73; used 4 times

- in /usr/src/bin/csh/sh.proc.c line 488, 499-500(2), 523

pmaxindex defined in line 79; used 7 times

- in /usr/src/bin/csh/sh.proc.c line 304-308(2), 378-379(2), 388-389(2), 694

pprevious defined in line 77; used 12 times

- in /usr/src/bin/csh/sh.proc.c line 106, 321-329(6), 396-397(2), 562, 932-934(2)

proclist defined in line 70; used 14 times

- in /usr/src/bin/csh/sh.proc.c line 50, 144, 169, 256, 273, 305, 384, 399-400(2), 695, 915, 938, 944, 980

#### Defined struct's

process defined in line 21; used 94 times

- in line 22-23(4), 70-84(16)
- in /usr/src/bin/csh/sh.proc.c line 33-34(4), 139(2), 162(2), 188-190(4), 250(2), 271(2), 284-286(4), 317(2), 344-347(6), 363(2), 381(2), 509(2), 530-533(4), 658(2), 664(2), 683(2), 710(2), 727(2), 741(2), 757(2), 818(2), 880-883(4), 912(2), 920-924(4), 973-978(8), 997(2)

#### Defined macros

AMPERSAND defined in line 64; used 2 times

- in /usr/src/bin/csh/sh.proc.c line 622, 902

AREASON defined in line 68; used 4 times

- in /usr/src/bin/csh/sh.proc.c line 223, 567, 591, 619

FANCY defined in line 65; used 3 times

- in /usr/src/bin/csh/sh.proc.c line 550, 565, 692

JOBDIR defined in line 67; used 3 times

- in /usr/src/bin/csh/sh.proc.c line 624, 692, 902

NAME defined in line 62; used 7 times

- in /usr/src/bin/csh/sh.proc.c line 125, 148, 568, 612, 684, 902(2)

NUMBER defined in line 61; used 6 times

- in /usr/src/bin/csh/sh.proc.c line 125, 148, 557, 650, 684, 902

PAEXITED defined in line 41; used 3 times

- in line 44
- in /usr/src/bin/csh/sh.proc.c line 76, 113

PALLSTATES defined in line 44; used 1 times

- in /usr/src/bin/csh/sh.proc.c line 549

PAWAITED defined in line 47; never used
PDIAG defined in line 50; used 2 times

- in /usr/src/bin/csh/sh.proc.c line 359, 616

PDUMPED defined in line 49; used 2 times

- in /usr/src/bin/csh/sh.proc.c line 71, 619

PFOREGND defined in line 48; used 7 times

- in /usr/src/bin/csh/sh.proc.c line 91, 110, 198, 349, 511, 895-897(2)

PINTERRUPTED defined in line 53; used 4 times

- in line 44
- in /usr/src/bin/csh/sh.proc.c line 67, 225, 236

PMAXLEN defined in line 58; used 4 times

- in /usr/src/bin/csh/sh.proc.c line 333, 467-471(3)

PNEEDNOTE defined in line 55; used 5 times

- in /usr/src/bin/csh/sh.proc.c line 129, 145-147(2), 302, 697

PNEXITED defined in line 40; used 2 times

- in line 44
- in /usr/src/bin/csh/sh.proc.c line 78

PNOTIFY defined in line 45; used 2 times

- in /usr/src/bin/csh/sh.proc.c line 123, 1000

PNULL defined in line 57; used 15 times

- in /usr/src/bin/csh/sh.proc.c line 50, 144, 169, 273, 321, 394-396(2), 489, 500, 927-932(2), 943, 978, 985, 1050

PPOU defined in line 51; used 2 times

- in /usr/src/bin/csh/sh.proc.c line 357, 614

PPTIME defined in line 54; used 9 times

- in /usr/src/bin/csh/sh.proc.c line 62, 84, 92-93(2), 111, 351, 540-541(2), 631

PREPORTED defined in line 52; used 3 times

- in /usr/src/bin/csh/sh.proc.c line 57, 96-100(2)

PRUNNING defined in line 38; used 17 times

- in line 44
- in /usr/src/bin/csh/sh.proc.c line 57, 84, 96, 149, 198(2), 212, 258, 349(2), 631, 649, 698, 841, 891-892(2)

PSIGNALED defined in line 42; used 5 times

- in line 44
- in /usr/src/bin/csh/sh.proc.c line 69, 111, 219, 236

PSTOPPED defined in line 39; used 22 times

- in line 44
- in /usr/src/bin/csh/sh.proc.c line 57-59(2), 84, 99-104(2), 111, 126, 149, 219-227(4), 511, 631, 649, 698, 891-893(2), 905, 916, 983

PTIME defined in line 46; used 6 times

- in /usr/src/bin/csh/sh.proc.c line 62, 88, 94, 219, 542, 649

REASON defined in line 63; used 8 times

- in /usr/src/bin/csh/sh.proc.c line 125, 148, 552, 567, 591, 599, 619, 684

SHELLDIR defined in line 66; used 2 times

- in /usr/src/bin/csh/sh.proc.c line 223, 642

#### Usage of this include

sh.proc.h used 2 times

- in /usr/src/bin/csh/sh.proc.c line 13
- in /usr/src/bin/csh/sh.sem.c line 12

Last modified: 1987-02-08 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1109 |