0400 /* 0401 * The user structure. 0402 * One allocated per process. 0403 * Contains all per process data 0404 * that doesn't need to be referenced 0405 * while the process is swapped. 0406 * The user block is USIZE*64 bytes 0407 * long; resides at virtual kernel 0408 * loc 140000; contains the system 0409 * stack per user; is cross referenced 0410 * with the proc structure for the 0411 * same process. 0412 */ 0413 struct user 0414 { 0415 int u_rsav[2]; /* save r5,r6 when exchanging stacks */ 0416 int u_fsav[25]; /* save fp registers */ 0417 /* rsav and fsav must be first in structure */ 0418 char u_segflg; /* flag for IO; user or kernel space */ 0419 char u_error; /* return error code */ 0420 char u_uid; /* effective user id */ 0421 char u_gid; /* effective group id */ 0422 char u_ruid; /* real user id */ 0423 char u_rgid; /* real group id */ 0424 int u_procp; /* pointer to proc structure */ 0425 char *u_base; /* base address for IO */ 0426 char *u_count; /* bytes remaining for IO */ 0427 char *u_offset[2]; /* offset in file for IO */ 0428 int *u_cdir; /* pointer to inode of current directory */ 0429 char u_dbuf[DIRSIZ]; /* current pathname component */ 0430 char *u_dirp; /* current pointer to inode */ 0431 struct { /* current directory entry */ 0432 int u_ino; 0433 char u_name[DIRSIZ]; 0434 } u_dent; 0435 int *u_pdir; /* inode of parent directory of dirp */ 0436 int u_uisa[16]; /* prototype of segmentation addresses */ 0437 int u_uisd[16]; /* prototype of segmentation descriptors */ 0438 int u_ofile[NOFILE]; /* pointers to file structures of open files */ 0439 0440 int u_arg[5]; /* arguments to current system call */ 0441 int u_tsize; /* text size (*64) */ 0442 int u_dsize; /* data size (*64) */ 0443 int u_ssize; /* stack size (*64) */ 0444 int u_sep; /* flag for I and D separation */ 0445 int u_qsav[2]; /* label variable for quits and interrupts */ 0446 int u_ssav[2]; /* label variable for swapping */ 0447 int u_signal[NSIG]; /* disposition of signals */ 0448 int u_utime; /* this process user time */ 0449 int u_stime; /* this process system time */ 0450 int u_cutime[2]; /* sum of childs' utimes */ 0451 int u_cstime[2]; /* sum of childs' stimes */ 0452 int *u_ar0; /* address of users saved R0 */ 0453 int u_prof[4]; /* profile arguments */ 0454 char u_intflg; /* catch intr from sys */ 0455 /* kernel stack per user 0456 * extends from u + USIZE*64 0457 * backward not to reach here 0458 */ 0459 } u; 0460 /* ------------------------ */ 0461 0462 /* u_error codes */ 0463 /* See section "INTRO(II)" of 0464 * the UNIX Programmer's manual 0465 * for the meanings of these codes. */ 0466 #define EFAULT 106 0467 #define EPERM 1 0468 #define ENOENT 2 0469 #define ESRCH 3 0470 #define EINTR 4 0471 #define EIO 5 0472 #define ENXIO 6 0473 #define E2BIG 7 0474 #define ENOEXEC 8 0475 #define EBADF 9 0476 #define ECHILD 10 0477 #define EAGAIN 11 0478 #define ENOMEM 12 0479 #define EACCES 13 0480 #define ENOTBLK 15 0481 #define EBUSY 16 0482 #define EEXIST 17 0483 #define EXDEV 18 0484 #define ENODEV 19 0485 #define ENOTDIR 20 0486 #define EISDIR 21 0487 #define EINVAL 22 0488 #define ENFILE 23 0489 #define EMFILE 24 0490 #define ENOTTY 25 0491 #define ETXTBSY 26 0492 #define EFBIG 27 0493 #define ENOSPC 28 0494 #define ESPIPE 29 0495 #define EROFS 30 0496 #define EMLINK 31 0497 #define EPIPE 32 0498 0499