home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / sys / table.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  6.3 KB  |  221 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    table.h,v $
  29.  * Revision 2.1  92/04/21  17:17:53  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. #ifndef    _SYS_TABLE_H_
  36. #define _SYS_TABLE_H_
  37.  
  38. #define TBL_TTYLOC        0    /* index by device number */
  39. #define TBL_U_TTYD        1    /* index by process ID */
  40. #define TBL_UAREA        2    /* index by process ID */
  41. #define TBL_LOADAVG        3    /* (no index) */
  42. #define TBL_INCLUDE_VERSION    4    /* (no index) */
  43. #define TBL_FSPARAM        5    /* index by device number */
  44. #define TBL_ARGUMENTS        6    /* index by process ID */
  45. #define TBL_MAXUPRC        7    /* index by process ID */
  46. #define TBL_AID            8    /* index by process ID */
  47. #define TBL_MODES        9    /* index by process ID */
  48. #define TBL_PROCINFO        10    /* index by proc table slot */
  49. #define TBL_ENVIRONMENT        11    /* index by process ID */
  50. #define TBL_SYSINFO        12    /* (no index) */
  51. #define TBL_DKINFO        13    /* index by disk */
  52. #define TBL_TTYINFO        14    /* (no index) */
  53. #define TBL_MSGDS        15    /* index by array index */
  54. #define TBL_SEMDS        16    /* index by array index */
  55. #define TBL_SHMDS        17    /* index by array index */
  56. #define TBL_MSGINFO        18    /* index by structure element */
  57. #define TBL_SEMINFO        19    /* index by structure element */
  58. #define TBL_SHMINFO        20    /* index by structure element */
  59. #define TBL_INTR        21    /* (no index) */
  60.  
  61. #define MSGINFO_MAX        0    /* max message size */
  62. #define MSGINFO_MNB        1    /* max # bytes on queue */
  63. #define MSGINFO_MNI        2    /* # of message queue identifiers */
  64. #define MSGINFO_TQL        3    /* # of system message headers */
  65.  
  66. #define    SEMINFO_MNI        0    /* # of semaphore identifiers */
  67. #define    SEMINFO_MSL        1    /* max # of semaphores per id */
  68. #define    SEMINFO_OPM        2    /* max # of operations per semop call */
  69. #define    SEMINFO_UME        3    /* max # of undo entries per process */
  70. #define    SEMINFO_VMX        4    /* semaphore maximum value */
  71. #define    SEMINFO_AEM        5    /* adjust on exit max value */
  72.  
  73. #define SHMINFO_MAX        0    /* max shared memory segment size */
  74. #define SHMINFO_MIN        1    /* min shared memory segment size */
  75. #define SHMINFO_MNI        2    /* num shared memory identifiers */
  76. #define SHMINFO_SEG        3    /* max attached shared memory segments per process */
  77.  
  78. /*
  79.  * Values for ihs_type -- don't really belong here, but...
  80.  */
  81.                     /* interrupt types */
  82. #define INTR_NOSPEC   0x0000
  83. #define INTR_HARDCLK  0x0001
  84. #define INTR_SOFTCLK  0x0002
  85. #define INTR_DEVICE   0x0004
  86. #define INTR_OTHER    0x0008
  87. #define INTR_STRAY    0x8000
  88. #define INTR_DISABLED 0x4000
  89.  
  90. #define INTR_CLOCK    (INTR_HARDCLK|INTR_SOFTCLK)
  91. #define INTR_NOTCLOCK (~INTR_CLOCK)
  92.  
  93.  
  94.  
  95. /*
  96.  *  TBL_FSPARAM data layout
  97.  */
  98.  
  99. struct tbl_fsparam
  100. {
  101.     long tf_used;        /* free fragments */
  102.     long tf_iused;        /* free inodes */
  103.     long tf_size;        /* total fragments */
  104.     long tf_isize;        /* total inodes */
  105. };
  106.  
  107.  
  108. /*
  109.  *  TBL_LOADAVG data layout
  110.  */
  111.  
  112. struct tbl_loadavg
  113. {
  114.     union {
  115.         long   l[3];
  116.         double d[3];
  117.     } tl_avenrun;
  118.     int    tl_lscale;        /* 0 scale when floating point */
  119.     long   tl_mach_factor[3];
  120. };
  121.  
  122.  
  123. /*
  124.  *  TBL_INTR data layout
  125.  */
  126.  
  127. struct tbl_intr
  128. {
  129.     long       in_devintr;    /* Device interrupts (non-clock) */
  130.     long       in_context;    /* Context switches */
  131.     long       in_syscalls;    /* Syscalls */
  132.     long       in_forks;    /* Forks */
  133.     long       in_vforks;    /* Vforks */
  134. };
  135.  
  136.  
  137. /*
  138.  *  TBL_MODES bit definitions
  139.  */
  140.  
  141. #define UMODE_P_GID    01    /* - 4.2 parent GID on inode create */
  142. #define UMODE_NOFOLLOW    02    /* - don't follow symbolic links */
  143. #define UMODE_NONICE    04    /* - don't auto-nice long job */
  144.  
  145.  
  146.  
  147. /*
  148.  *    TBL_PROCINFO data layout
  149.  */
  150. #define PI_COMLEN    19    /* length of command string */
  151. struct tbl_procinfo
  152. {
  153.     int        pi_uid;        /* (effective) user ID */
  154.     int        pi_pid;        /* proc ID */
  155.     int        pi_ppid;    /* parent proc ID */
  156.     int        pi_pgrp;    /* proc group ID */
  157.     int        pi_ttyd;    /* controlling terminal number */
  158.     int        pi_status;    /* process status: */
  159. #define PI_EMPTY    0        /* no process */
  160. #define PI_ACTIVE    1        /* active process */
  161. #define PI_EXITING    2        /* exiting */
  162. #define PI_ZOMBIE    3        /* zombie */
  163.     int        pi_flag;    /* other random flags */
  164.     char    pi_comm[PI_COMLEN+1];
  165.                 /* short command name */
  166.     int        pi_ruid;        /* (real) user ID */
  167.     int        pi_svuid;       /* saved (effective) user ID */
  168.     int         pi_rgid;        /* (real) group ID */
  169.     int         pi_svgid;       /* saved (effective) group ID */
  170.     int        pi_session;    /* session ID */
  171.     int         pi_tpgrp;       /* tty pgrp */
  172.     int         pi_tsession;    /* tty session id */
  173.     int         pi_jobc;        /* # procs qualifying pgrp for job control */
  174.     int         pi_cursig;
  175.     int         pi_sig;         /* signals pending */
  176.     int         pi_sigmask;     /* current signal mask */
  177.     int         pi_sigignore;   /* signals being ignored */
  178.     int         pi_sigcatch;    /* signals being caught by user */
  179. };
  180.  
  181. /*
  182.  *    TBL_SYSINFO data layout
  183.  */
  184. struct tbl_sysinfo {
  185.         long    si_user;        /* User time */
  186.         long    si_nice;        /* Nice time */
  187.         long    si_sys;            /* System time */
  188.         long    si_idle;        /* Idle time */
  189.         long    si_hz;
  190.         long    si_phz;
  191.     long     si_boottime;        /* Boot time in seconds */
  192. };
  193.  
  194. /*
  195.  *    TBL_DKINFO data layout
  196.  */
  197. #define DI_NAMESZ    8
  198. struct tbl_dkinfo {
  199.         int    di_ndrive;
  200.         int    di_busy;
  201.         long    di_time;
  202.         long    di_seek;
  203.         long    di_xfer;
  204.         long    di_wds;
  205.         long    di_wpms;
  206.         int    di_unit;
  207.         char    di_name[DI_NAMESZ+1];
  208. };
  209.         
  210. /*
  211.  *    TBL_TTYINFO data layout
  212.  */
  213. struct tbl_ttyinfo {
  214.         long    ti_nin;
  215.         long    ti_nout;
  216.         long    ti_cancc;
  217.         long    ti_rawcc;
  218. };
  219.  
  220. #endif    _SYS_TABLE_H_
  221.