h/user.h

00550 /* 00551 * The user structure. 00552 * One allocated per process. 00553 * Contains all per process data 00554 * that doesn't need to be referenced 00555 * while the process is swapped. 00556 * The user block is USIZE*64 bytes 00557 * long; resides at virtual kernel 00558 * loc 140000; contains the system 00559 * stack per user; is cross referenced 00560 * with the proc structure for the 00561 * same process. 00562 */ 00563 00564 #define EXCLOSE 01 00565 00566 struct user 00567 { 00568 label_t u_rsav; /* save info when exchanging stacks */ 00569 int u_fper; /* FP error register */ 00570 int u_fpsaved; /* FP regs saved for this proc */ 00571 struct { 00572 int u_fpsr; /* FP status register */ 00573 double u_fpregs[6]; /* FP registers */ 00574 } u_fps; 00575 char u_segflg; /* IO flag: 0:user D; 1:system; 2:user I */ 00576 char u_error; /* return error code */ 00577 short u_uid; /* effective user id */ 00578 short u_gid; /* effective group id */ 00579 short u_ruid; /* real user id */ 00580 short u_rgid; /* real group id */ 00581 struct proc *u_procp; /* pointer to proc structure */ 00582 int *u_ap; /* pointer to arglist */ 00583 union { /* syscall return values */ 00584 struct { 00585 int r_val1; 00586 int r_val2; 00587 }; 00588 off_t r_off; 00589 time_t r_time; 00590 } u_r; 00591 caddr_t u_base; /* base address for IO */ 00592 unsigned int u_count; /* bytes remaining for IO */ 00593 off_t u_offset; /* offset in file for IO */ 00594 struct inode *u_cdir; /* pointer to inode of current directory */ 00595 struct inode *u_rdir; /* root directory of current process */ 00596 char u_dbuf[DIRSIZ]; /* current pathname component */ 00597 caddr_t u_dirp; /* pathname pointer */ 00598 struct direct u_dent; /* current directory entry */ 00599 struct inode *u_pdir; /* inode of parent directory of dirp */ 00600 int u_uisa[16]; /* prototype of segmentation addresses */ 00601 int u_uisd[16]; /* prototype of segmentation descriptors */ 00602 struct file *u_ofile[NOFILE]; /* pointers to file structures of open files */ 00603 char u_pofile[NOFILE]; /* per-process flags of open files */ 00604 int u_arg[5]; /* arguments to current system call */ 00605 unsigned u_tsize; /* text size (clicks) */ 00606 unsigned u_dsize; /* data size (clicks) */ 00607 unsigned u_ssize; /* stack size (clicks) */ 00608 label_t u_qsav; /* label variable for quits and interrupts */ 00609 label_t u_ssav; /* label variable for swapping */ 00610 int u_signal[NSIG]; /* disposition of signals */ 00611 time_t u_utime; /* this process user time */ 00612 time_t u_stime; /* this process system time */ 00613 time_t u_cutime; /* sum of childs' utimes */ 00614 time_t u_cstime; /* sum of childs' stimes */ 00615 int *u_ar0; /* address of users saved R0 */ 00616 struct { /* profile arguments */ 00617 short *pr_base; /* buffer base */ 00618 unsigned pr_size; /* buffer size */ 00619 unsigned pr_off; /* pc offset */ 00620 unsigned pr_scale; /* pc scaling */ 00621 } u_prof; 00622 char u_intflg; /* catch intr from sys */ 00623 char u_sep; /* flag for I and D separation */ 00624 struct tty *u_ttyp; /* controlling tty pointer */ 00625 dev_t u_ttyd; /* controlling tty dev */ 00626 struct { /* header of executable file */ 00627 int ux_mag; /* magic number */ 00628 unsigned ux_tsize; /* text size */ 00629 unsigned ux_dsize; /* data size */ 00630 unsigned ux_bsize; /* bss size */ 00631 unsigned ux_ssize; /* symbol table size */ 00632 unsigned ux_entloc; /* entry location */ 00633 unsigned ux_unused; 00634 unsigned ux_relflg; 00635 } u_exdata; 00636 char u_comm[DIRSIZ]; 00637 time_t u_start; 00638 char u_acflag; 00639 short u_fpflag; /* unused now, will be later */ 00640 short u_cmask; /* mask for file creation */ 00641 int u_stack[1]; 00642 /* kernel stack per user 00643 * extends from u + USIZE*64 00644 * backward not to reach here 00645 */ 00646 }; 00647 00648 extern struct user u; 00649 00650 /* u_error codes */ 00651 #define EPERM 1 00652 #define ENOENT 2 00653 #define ESRCH 3 00654 #define EINTR 4 00655 #define EIO 5 00656 #define ENXIO 6 00657 #define E2BIG 7 00658 #define ENOEXEC 8 00659 #define EBADF 9 00660 #define ECHILD 10 00661 #define EAGAIN 11 00662 #define ENOMEM 12 00663 #define EACCES 13 00664 #define EFAULT 14 00665 #define ENOTBLK 15 00666 #define EBUSY 16 00667 #define EEXIST 17 00668 #define EXDEV 18 00669 #define ENODEV 19 00670 #define ENOTDIR 20 00671 #define EISDIR 21 00672 #define EINVAL 22 00673 #define ENFILE 23 00674 #define EMFILE 24 00675 #define ENOTTY 25 00676 #define ETXTBSY 26 00677 #define EFBIG 27 00678 #define ENOSPC 28 00679 #define ESPIPE 29 00680 #define EROFS 30 00681 #define EMLINK 31 00682 #define EPIPE 32 00683 #define EDOM 33 00684 #define ERANGE 34 00685 00686 00687 00688 00689 00690 00691 00692 00693 00694 00695 00696 00697 00698 00699