home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / 2014.11.minnie.tuhs.org.tar / minnie.tuhs.org / UnixArchive / PDP-11 / Trees / V6 / usr / sys / user.h < prev   
C/C++ Source or Header  |  1975-07-18  |  3KB  |  94 lines

  1. /*
  2.  * The user structure.
  3.  * One allocated per process.
  4.  * Contains all per process data
  5.  * that doesn't need to be referenced
  6.  * while the process is swapped.
  7.  * The user block is USIZE*64 bytes
  8.  * long; resides at virtual kernel
  9.  * loc 140000; contains the system
  10.  * stack per user; is cross referenced
  11.  * with the proc structure for the
  12.  * same process.
  13.  */
  14. struct user
  15. {
  16.     int    u_rsav[2];        /* save r5,r6 when exchanging stacks */
  17.     int    u_fsav[25];        /* save fp registers */
  18.                     /* rsav and fsav must be first in structure */
  19.     char    u_segflg;        /* flag for IO; user or kernel space */
  20.     char    u_error;        /* return error code */
  21.     char    u_uid;            /* effective user id */
  22.     char    u_gid;            /* effective group id */
  23.     char    u_ruid;            /* real user id */
  24.     char    u_rgid;            /* real group id */
  25.     int    u_procp;        /* pointer to proc structure */
  26.     char    *u_base;        /* base address for IO */
  27.     char    *u_count;        /* bytes remaining for IO */
  28.     char    *u_offset[2];        /* offset in file for IO */
  29.     int    *u_cdir;        /* pointer to inode of current directory */
  30.     char    u_dbuf[DIRSIZ];        /* current pathname component */
  31.     char    *u_dirp;        /* current pointer to inode */
  32.     struct    {            /* current directory entry */
  33.         int    u_ino;
  34.         char    u_name[DIRSIZ];
  35.     } u_dent;
  36.     int    *u_pdir;        /* inode of parent directory of dirp */
  37.     int    u_uisa[16];        /* prototype of segmentation addresses */
  38.     int    u_uisd[16];        /* prototype of segmentation descriptors */
  39.     int    u_ofile[NOFILE];    /* pointers to file structures of open files */
  40.     int    u_arg[5];        /* arguments to current system call */
  41.     int    u_tsize;        /* text size (*64) */
  42.     int    u_dsize;        /* data size (*64) */
  43.     int    u_ssize;        /* stack size (*64) */
  44.     int    u_sep;            /* flag for I and D separation */
  45.     int    u_qsav[2];        /* label variable for quits and interrupts */
  46.     int    u_ssav[2];        /* label variable for swapping */
  47.     int    u_signal[NSIG];        /* disposition of signals */
  48.     int    u_utime;        /* this process user time */
  49.     int    u_stime;        /* this process system time */
  50.     int    u_cutime[2];        /* sum of childs' utimes */
  51.     int    u_cstime[2];        /* sum of childs' stimes */
  52.     int    *u_ar0;            /* address of users saved R0 */
  53.     int    u_prof[4];        /* profile arguments */
  54.     char    u_intflg;        /* catch intr from sys */
  55.                     /* kernel stack per user
  56.                      * extends from u + USIZE*64
  57.                      * backward not to reach here
  58.                      */
  59. } u;
  60.  
  61. /* u_error codes */
  62. #define    EFAULT    106
  63. #define    EPERM    1
  64. #define    ENOENT    2
  65. #define    ESRCH    3
  66. #define    EINTR    4
  67. #define    EIO    5
  68. #define    ENXIO    6
  69. #define    E2BIG    7
  70. #define    ENOEXEC    8
  71. #define    EBADF    9
  72. #define    ECHILD    10
  73. #define    EAGAIN    11
  74. #define    ENOMEM    12
  75. #define    EACCES    13
  76. #define    ENOTBLK    15
  77. #define    EBUSY    16
  78. #define    EEXIST    17
  79. #define    EXDEV    18
  80. #define    ENODEV    19
  81. #define    ENOTDIR    20
  82. #define    EISDIR    21
  83. #define    EINVAL    22
  84. #define    ENFILE    23
  85. #define    EMFILE    24
  86. #define    ENOTTY    25
  87. #define    ETXTBSY    26
  88. #define    EFBIG    27
  89. #define    ENOSPC    28
  90. #define    ESPIPE    29
  91. #define    EROFS    30
  92. #define    EMLINK    31
  93. #define    EPIPE    32
  94.