Annotation of researchv10dc/lsys/sys/user.h, revision 1.1

1.1     ! root        1: #include <sys/pcb.h>
        !             2: #include <sys/dmap.h>
        !             3: #include <sys/vtimes.h>
        !             4: /*
        !             5:  * The user structure.
        !             6:  * One allocated per process.
        !             7:  * Contains all per process data
        !             8:  * that doesn't need to be referenced
        !             9:  * while the process is swapped.
        !            10:  * The user block is UPAGES*NBPG bytes
        !            11:  * long; resides at virtual user
        !            12:  * loc 0x80000000-UPAGES*NBPG; contains the system
        !            13:  * stack per user; is cross referenced
        !            14:  * with the proc structure for the
        !            15:  * same process.
        !            16:  */
        !            17:  
        !            18: #define        SHSIZE  32
        !            19: #define        NOGROUP (short)-1               /* endmarker */
        !            20: /* should NGROUPS be here? */
        !            21:  
        !            22: struct user
        !            23: {
        !            24:        struct  pcb u_pcb;
        !            25:        int     junk1;                  /* temp; pcb shrank */
        !            26:        int     u_arg[5];               /* arguments to current system call */
        !            27:        label_t u_qsav;                 /* for non-local gotos on interrupts */
        !            28:        char    u_segflg;               /* 0:user D; 1:system; 2:user I */
        !            29: #define        SEGUDATA        0
        !            30: #define        SEGSYS          1
        !            31: #define        SEGUINST        2
        !            32:        char    u_error;                /* return error code */
        !            33:        short   u_uid;                  /* effective user id */
        !            34:        short   u_gid;                  /* effective group id */
        !            35:        short   u_ruid;                 /* real user id */
        !            36:        short   u_rgid;                 /* real group id */
        !            37:        short   u_groups[NGROUPS];      /* array of groups really looked at */
        !            38:        struct  proc *u_procp;          /* pointer to proc structure */
        !            39:        int     *u_ap;                  /* pointer to arglist */
        !            40:        union {                         /* syscall return values */
        !            41:                struct  {
        !            42:                        int     R_val1;
        !            43:                        int     R_val2;
        !            44:                } u_rv;
        !            45: #define        r_val1  u_rv.R_val1
        !            46: #define        r_val2  u_rv.R_val2
        !            47:                off_t   r_off;
        !            48:                time_t  r_time;
        !            49:        } u_r;
        !            50:        caddr_t u_base;                 /* base address for IO */
        !            51:        unsigned int u_count;           /* bytes remaining for IO */
        !            52:        Long    u_offset;               /* offset in file for IO */
        !            53:        struct  inode *u_cdir;          /* pointer to inode of current directory */
        !            54:        struct  inode *u_rdir;          /* root directory of current process */
        !            55:        char    junk2[14];              /* used to be current pathname component */
        !            56:        char    junk4[14+2];            /* used to be current directory entry */
        !            57:        struct  file *u_ofile[NOFILE];  /* pointers to file structures of open files */
        !            58:        char    u_pofile[NOFILE];       /* per-process flags of open files */
        !            59: #define        EXCLOSE 01              /* auto-close on exec */
        !            60:        label_t u_ssav;                 /* label variable for swapping */
        !            61:        int     (*u_signal[NSIG])();    /* disposition of signals */
        !            62:        int     u_code;                 /* ``code'' to trap */
        !            63: /* on SIGILL code passes compatibility mode fault address  */
        !            64: /* on SIGFPE code passes more specific kind of floating point fault */
        !            65:        int     *u_ar0;                 /* address of users saved R0 */
        !            66:        struct uprof {                  /* profile arguments */
        !            67:                short   *pr_base;       /* buffer base */
        !            68:                unsigned pr_size;       /* buffer size */
        !            69:                unsigned pr_off;        /* pc offset */
        !            70:                unsigned pr_scale;      /* pc scaling */
        !            71:        } u_prof;
        !            72:        short   junk5;          /* was u_eosys/u_sep */
        !            73:        dev_t   u_ttydev;               /* dev,ino of controlling tty */
        !            74:        ino_t   u_ttyino;
        !            75:        union {
        !            76:           struct {                     /* header of executable file */
        !            77:                int     Ux_mag;         /* magic number */
        !            78:                unsigned Ux_tsize;      /* text size */
        !            79:                unsigned Ux_dsize;      /* data size */
        !            80:                unsigned Ux_bsize;      /* bss size */
        !            81:                unsigned Ux_ssize;      /* symbol table size */
        !            82:                unsigned Ux_entloc;     /* entry location */
        !            83:                unsigned Ux_unused;
        !            84:                unsigned Ux_relflg;
        !            85:           } Ux_A;
        !            86:           char ux_shell[SHSIZE];       /* #! and name of interpreter */
        !            87:        } u_exdata;
        !            88: #define        ux_mag          Ux_A.Ux_mag
        !            89: #define        ux_tsize        Ux_A.Ux_tsize
        !            90: #define        ux_dsize        Ux_A.Ux_dsize
        !            91: #define        ux_bsize        Ux_A.Ux_bsize
        !            92: #define        ux_ssize        Ux_A.Ux_ssize
        !            93: #define        ux_entloc       Ux_A.Ux_entloc
        !            94: #define        ux_unused       Ux_A.Ux_unused
        !            95: #define        ux_relflg       Ux_A.Ux_relflg
        !            96: 
        !            97:        char    u_comm[14];             /* needs to be >= acct.ac_comm */
        !            98:        time_t  u_start;
        !            99:        char    u_acflag;
        !           100:        short   junk6;          /* was u_fpflag */
        !           101:        short   u_cmask;                /* mask for file creation */
        !           102:        clicks_t        u_tsize;                /* text size (clicks) */
        !           103:        clicks_t        u_dsize;                /* data size (clicks) */
        !           104:        clicks_t        u_ssize;                /* stack size (clicks) */
        !           105:        struct  vtimes u_vm;            /* stats for this proc */
        !           106:        struct  vtimes u_cvm;           /* sum of stats for reaped children */
        !           107:        struct  dmap u_dmap;            /* disk map for data segment */
        !           108:        struct  dmap u_smap;            /* disk map for stack segment */
        !           109:        struct  dmap u_cdmap, u_csmap;  /* shadows of u_dmap, u_smap, for
        !           110:                                           use of parent during fork */
        !           111:        time_t  u_outime;               /* user time at last sample */
        !           112:        clicks_t        u_odsize, u_ossize;     /* for (clumsy) expansion swaps */
        !           113:        int     u_limit[8];             /* see <sys/vlimit.h> */
        !           114:        int     u_nbadio;               /* # IO operations on hungup streams */
        !           115:        char    u_logname[8];           /* login name */
        !           116:        int     u_stack[1];
        !           117: 
        !           118:                                        /*
        !           119:                                         * kernel stack per user
        !           120:                                         * extends from u + UPAGES*512
        !           121:                                         * backward not to reach here
        !           122:                                         */
        !           123: };
        !           124: 
        !           125: /* u_eosys values */
        !           126: #define        JUSTRETURN      0
        !           127: #define        RESTARTSYS      1
        !           128: #define        SIMULATERTI     2
        !           129: 
        !           130: /* u_error codes */
        !           131: #include <errno.h>
        !           132: 
        !           133: #ifdef KERNEL
        !           134: extern struct user u;
        !           135: extern struct user *swaputl;
        !           136: extern struct user *forkutl;
        !           137: extern struct user *xswaputl;
        !           138: extern struct user *xswap2utl;
        !           139: extern struct user *pushutl;
        !           140: extern struct user *prusrutl;
        !           141: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.