# 2.11BSD#431 - /usr/src/bin/tcsh/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
    _h_sh_proc        X

##### struct's

    process           X

       1: /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.proc.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */
       2: /*
       3:  * sh.proc.h: Process data structures and variables
       4:  */
       5: /*-
       6:  * Copyright (c) 1980, 1991 The Regents of the University of California.
       7:  * All rights reserved.
       8:  *
       9:  * Redistribution and use in source and binary forms, with or without
      10:  * modification, are permitted provided that the following conditions
      11:  * are met:
      12:  * 1. Redistributions of source code must retain the above copyright
      13:  *    notice, this list of conditions and the following disclaimer.
      14:  * 2. Redistributions in binary form must reproduce the above copyright
      15:  *    notice, this list of conditions and the following disclaimer in the
      16:  *    documentation and/or other materials provided with the distribution.
      17:  * 3. All advertising materials mentioning features or use of this software
      18:  *    must display the following acknowledgement:
      19:  *	This product includes software developed by the University of
      20:  *	California, Berkeley and its contributors.
      21:  * 4. Neither the name of the University nor the names of its contributors
      22:  *    may be used to endorse or promote products derived from this software
      23:  *    without specific prior written permission.
      24:  *
      25:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
      26:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      27:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      28:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
      29:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      30:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      31:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      32:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      33:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      34:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      35:  * SUCH DAMAGE.
      36:  */
      37: #ifndef _h_sh_proc
      38: #define _h_sh_proc
      39: /*
      40:  * C shell - process structure declarations
      41:  */
      42:
      43: /*
      44:  * Structure for each process the shell knows about:
      45:  *	allocated and filled by pcreate.
      46:  *	flushed by pflush; freeing always happens at top level
      47:  *	    so the interrupt level has less to worry about.
      48:  *	processes are related to "friends" when in a pipeline;
      49:  *	    p_friends links makes a circular list of such jobs
      50:  */
      51: struct process {
      52:     struct process *p_next; /* next in global "proclist" */
      53:     struct process *p_friends;  /* next in job list (or self) */
      54:     struct directory *p_cwd;    /* cwd of the job (only in head) */
      55:     short unsigned p_flags; /* various job status flags */
      56:     char    p_reason;       /* reason for entering this state */
      57:     int     p_index;        /* shorthand job index */
      58:     int     p_pid;
      59:     int     p_jobid;        /* pid of job leader */
      60:     /* if a job is stopped/background p_jobid gives its pgrp */
      61: #ifdef BSDTIMES
      62:     struct timeval p_btime; /* begin time */
      63:     struct timeval p_etime; /* end time */
      64:     struct rusage p_rusage;
      65: #else               /* BSDTIMES */
      66: # ifdef _SEQUENT_
      67:     tmval_t p_btime;        /* begin time */
      68:     tmval_t p_etime;        /* end time */
      69:     struct pro_stats p_rusage;
      70: # else              /* _SEQUENT_ */
      71: #  ifndef POSIX
      72:     time_t  p_btime;        /* begin time */
      73:     time_t  p_etime;        /* end time */
      74:     time_t  p_utime;        /* user time */
      75:     time_t  p_stime;        /* system time */
      76: #  else /* POSIX */
      77:     clock_t p_btime;        /* begin time */
      78:     clock_t p_etime;        /* end time */
      79:     clock_t p_utime;        /* user time */
      80:     clock_t p_stime;        /* system time */
      81: #  endif /* POSIX */
      82: # endif /* _SEQUENT_ */
      83: #endif /* BSDTIMES */
      84:     Char   *p_command;      /* first PMAXLEN chars of command */
      85: };
      86:
      87: /* flag values for p_flags */
      88: #define PRUNNING    (1<<0)  /* running */
      89: #define PSTOPPED    (1<<1)  /* stopped */
      90: #define PNEXITED    (1<<2)  /* normally exited */
      91: #define PAEXITED    (1<<3)  /* abnormally exited */
      92: #define PSIGNALED   (1<<4)  /* terminated by a signal != SIGINT */
      93:
      94: #define PALLSTATES  (PRUNNING|PSTOPPED|PNEXITED|PAEXITED| \
      95:              PSIGNALED|PINTERRUPTED)
      96: #define PNOTIFY     (1<<5)  /* notify async when done */
      97: #define PTIME       (1<<6)  /* job times should be printed */
      98: #define PAWAITED    (1<<7)  /* top level is waiting for it */
      99: #define PFOREGND    (1<<8)  /* started in shells pgrp */
     100: #define PDUMPED     (1<<9)  /* process dumped core */
     101: #define PDIAG       (1<<10) /* diagnostic output also piped out */
     102: #define PPOU        (1<<11) /* piped output */
     103: #define PREPORTED   (1<<12) /* status has been reported */
     104: #define PINTERRUPTED    (1<<13) /* job stopped via interrupt signal */
     105: #define PPTIME      (1<<14) /* time individual process */
     106: #define PNEEDNOTE   (1<<15) /* notify as soon as practical */
     107:
     108: #define PNULL       (struct process *)0
     109: #define PMAXLEN     80
     110:
     111: /* defines for arguments to pprint */
     112: #define NUMBER      01
     113: #define NAME        02
     114: #define REASON      04
     115: #define AMPERSAND   010
     116: #define FANCY       020
     117: #define SHELLDIR    040 /* print shell's dir if not the same */
     118: #define JOBDIR      0100    /* print job's dir if not the same */
     119: #define AREASON     0200
     120:
     121: struct process proclist;    /* list head of all processes */
     122: bool    pnoprocesses;       /* pchild found nothing to wait for */
     123:
     124: struct process *pholdjob;   /* one level stack of current jobs */
     125:
     126: struct process *pcurrjob;   /* current job */
     127: struct process *pcurrent;   /* current job in table */
     128: struct process *pprevious;  /* previous job in table */
     129:
     130: int   pmaxindex;        /* current maximum job index */
     131:
     132: #ifndef BSDTIMES
     133: bool    timesdone;      /* shtimes buffer full ? */
     134: #endif /* BSDTIMES */
     135:
     136: #endif /* _h_sh_proc */

#### Defined variables

pcurrent defined in line 127; used 14 times

- in /usr/src/bin/tcsh/sh.proc.c line 386-388(4), 718-724(3), 796-797(2), 989, 1537-1539(2), 1593
- in /usr/src/bin/tcsh/tc.func.c line 421

pcurrjob defined in line 126; used 24 times

- in /usr/src/bin/tcsh/sh.proc.c line 514, 694-695(2), 763-775(7), 913-914(2), 924, 937-938(3), 949, 1686-1688(3), 1752(2)
- in /usr/src/bin/tcsh/sh.sem.c line 411(2)

pholdjob defined in line 124; used 4 times

- in /usr/src/bin/tcsh/sh.proc.c line 913, 924-925(2), 949

pmaxindex defined in line 130; used 7 times

- in /usr/src/bin/tcsh/sh.proc.c line 702-706(2), 780-781(2), 790-791(2), 1219

pprevious defined in line 128; used 12 times

- in /usr/src/bin/tcsh/sh.proc.c line 387, 719-728(6), 798-799(2), 990, 1542-1544(2)

proclist defined in line 121; used 16 times

- in /usr/src/bin/tcsh/sh.proc.c line 294, 455, 495, 644, 670, 703, 786, 801-802(2), 1220, 1525, 1549, 1555, 1592
- in /usr/src/bin/tcsh/tc.func.c line 424, 873

#### Defined struct's

process defined in line 51; used 116 times

- in line 52-53(4), 121-128(10)
- in /usr/src/bin/tcsh/ed.chared.c line 1082(2)
- in /usr/src/bin/tcsh/sh.proc.c line 143-150(12), 165-166(4), 448(2), 482(2), 524-526(4), 629(2), 668(2), 682-684(4), 716(2), 745-748(6), 764(2), 783(2), 935(2), 957-961(4), 1121(2), 1128(2), 1148(2), 1176(2), 1208(2), 1236(2), 1260(2), 1281(2), 1298(2), 1369(2), 1476-1479(4), 1522(2), 1530-1534(4), 1585-1590(8), 1610(2)
- in /usr/src/bin/tcsh/tc.func.c line 395-398(4), 438(2), 836(2)
- in /usr/src/bin/tcsh/tc.os.c line 416(2)

#### Defined macros

AMPERSAND defined in line 115; used 2 times

- in /usr/src/bin/tcsh/sh.proc.c line 1076, 1504

AREASON defined in line 119; used 5 times

- in /usr/src/bin/tcsh/sh.proc.c line 595-598(2), 1003, 1038, 1073

FANCY defined in line 116; used 3 times

- in /usr/src/bin/tcsh/sh.proc.c line 978, 993, 1217

JOBDIR defined in line 118; used 3 times

- in /usr/src/bin/tcsh/sh.proc.c line 1078, 1217, 1504

NAME defined in line 113; used 7 times

- in /usr/src/bin/tcsh/sh.proc.c line 419, 463, 1004, 1066, 1209, 1504(2)

NUMBER defined in line 112; used 6 times

- in /usr/src/bin/tcsh/sh.proc.c line 419, 463, 985, 1112, 1209, 1504

PAEXITED defined in line 91; used 3 times

- in line 94
- in /usr/src/bin/tcsh/sh.proc.c line 345, 395

PALLSTATES defined in line 94; used 1 times

- in /usr/src/bin/tcsh/sh.proc.c line 977

PAWAITED defined in line 98; never used
PDIAG defined in line 101; used 2 times

- in /usr/src/bin/tcsh/sh.proc.c line 760, 1070

PDUMPED defined in line 100; used 2 times

- in /usr/src/bin/tcsh/sh.proc.c line 339, 1073

PFOREGND defined in line 99; used 7 times

- in /usr/src/bin/tcsh/sh.proc.c line 372, 392, 537, 750, 937, 1497-1499(2)

PINTERRUPTED defined in line 104; used 5 times

- in line 95
- in /usr/src/bin/tcsh/sh.proc.c line 335, 401, 600, 611

PMAXLEN defined in line 109; used 4 times

- in /usr/src/bin/tcsh/sh.proc.c line 732, 892-896(3)

PNEEDNOTE defined in line 106; used 5 times

- in /usr/src/bin/tcsh/sh.proc.c line 435, 456, 462, 700, 1222

PNEXITED defined in line 90; used 2 times

- in line 94
- in /usr/src/bin/tcsh/sh.proc.c line 347

PNOTIFY defined in line 96; used 2 times

- in /usr/src/bin/tcsh/sh.proc.c line 413, 1613

PNULL defined in line 108; used 20 times

- in /usr/src/bin/tcsh/ed.chared.c line 1085
- in /usr/src/bin/tcsh/sh.proc.c line 294, 455, 495, 670, 719, 796-798(2), 914, 925, 1537-1542(2), 1554, 1590, 1597, 1688
- in /usr/src/bin/tcsh/tc.func.c line 421-422(2), 433, 872

PPOU defined in line 102; used 3 times

- in /usr/src/bin/tcsh/sh.proc.c line 758, 1041, 1068

PPTIME defined in line 105; used 9 times

- in /usr/src/bin/tcsh/sh.proc.c line 313, 353, 373-374(2), 393, 752, 968-969(2), 1085

PREPORTED defined in line 103; used 3 times

- in /usr/src/bin/tcsh/sh.proc.c line 307, 377-381(2)

PRUNNING defined in line 88; used 17 times

- in line 94
- in /usr/src/bin/tcsh/sh.proc.c line 307, 353, 377, 464, 537(2), 556, 646, 750(2), 1085, 1111, 1223, 1411, 1493-1494(2)

PSIGNALED defined in line 92; used 5 times

- in line 95
- in /usr/src/bin/tcsh/sh.proc.c line 337, 393, 577, 611

PSTOPPED defined in line 89; used 23 times

- in line 94
- in /usr/src/bin/tcsh/sh.proc.c line 307-309(2), 353, 380-385(2), 393, 408, 420, 464, 577-579(2), 600-602(2), 937, 1085, 1111, 1223, 1493-1495(2), 1508, 1526, 1595

PTIME defined in line 97; used 8 times

- in /usr/src/bin/tcsh/sh.proc.c line 313, 369, 375, 408(2), 577, 970, 1111

REASON defined in line 114; used 8 times

- in /usr/src/bin/tcsh/sh.proc.c line 419, 463, 980, 1003, 1037, 1049, 1073, 1209

SHELLDIR defined in line 117; used 4 times

- in /usr/src/bin/tcsh/sh.proc.c line 592-598(3), 1104

_h_sh_proc defined in line 38; used 1 times

- in line 37

#### Usage of this include

sh.proc.h used 1 times

- in /usr/src/bin/tcsh/sh.h line 261

Last modified: 1991-08-20 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 689 |