home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / sys / h / proc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-03  |  2.4 KB  |  70 lines

  1. /*
  2.  * One structure allocated per active
  3.  * process. It contains all data needed
  4.  * about the process while the
  5.  * process may be swapped out.
  6.  * Other per process data (user.h)
  7.  * is swapped with the process.
  8.  */
  9. struct    proc {
  10.     char    p_stat;
  11.     char    p_flag;
  12.     char    p_pri;        /* priority, negative is high */
  13.     char    p_time;        /* resident time for scheduling */
  14.     char    p_cpu;        /* cpu usage for scheduling */
  15.     char    p_nice;        /* nice for cpu usage */
  16.     short    p_sig;        /* signals pending to this process */
  17.     short    p_uid;        /* user id, used to direct tty signals */
  18.     short    p_pgrp;        /* name of process group leader */
  19.     short    p_pid;        /* unique process id */
  20.     short    p_ppid;        /* process id of parent */
  21.     short    p_addr;        /* address of swappable image */
  22.     short    p_size;        /* size of swappable image (clicks) */
  23.     caddr_t p_wchan;    /* event process is awaiting */
  24.     struct text *p_textp;    /* pointer to text structure */
  25.     struct proc *p_link;    /* linked list of running processes */
  26.     int    p_clktim;    /* time to alarm clock signal */
  27. };
  28.  
  29. extern struct proc proc[];    /* the proc table itself */
  30.  
  31. /* stat codes */
  32. #define    SSLEEP    1        /* awaiting an event */
  33. #define    SWAIT    2        /* (abandoned state) */
  34. #define    SRUN    3        /* running */
  35. #define    SIDL    4        /* intermediate state in process creation */
  36. #define    SZOMB    5        /* intermediate state in process termination */
  37. #define    SSTOP    6        /* process being traced */
  38.  
  39. /* flag codes */
  40. #define    SLOAD    01        /* in core */
  41. #define    SSYS    02        /* scheduling process */
  42. #define    SLOCK    04        /* process cannot be swapped */
  43. #define    SSWAP    010        /* process is being swapped out */
  44. #define    STRC    020        /* process is being traced */
  45. #define    SWTED    040        /* another tracing flag */
  46. #define    SULOCK    0100        /* user settable lock in core */
  47.  
  48. /*
  49.  * parallel proc structure
  50.  * to replace part with times
  51.  * to be passed to parent process
  52.  * in ZOMBIE state.
  53.  */
  54. struct    xproc {
  55.     char    xp_stat;
  56.     char    xp_flag;
  57.     char    xp_pri;        /* priority, negative is high */
  58.     char    xp_time;    /* resident time for scheduling */
  59.     char    xp_cpu;        /* cpu usage for scheduling */
  60.     char    xp_nice;    /* nice for cpu usage */
  61.     short    xp_sig;        /* signals pending to this process */
  62.     short    xp_uid;        /* user id, used to direct tty signals */
  63.     short    xp_pgrp;    /* name of process group leader */
  64.     short    xp_pid;        /* unique process id */
  65.     short    xp_ppid;    /* process id of parent */
  66.     short    xp_xstat;    /* Exit status for wait */
  67.     time_t    xp_utime;    /* user time, this proc */
  68.     time_t    xp_stime;    /* system time, this proc */
  69. };
  70.