Annotation of researchv9/sys/h/file.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * One file structure is allocated
        !             3:  * for each open/creat/pipe call.
        !             4:  * Main use is to hold the read/write
        !             5:  * pointer associated with each open
        !             6:  * file.
        !             7:  */
        !             8: struct file
        !             9: {
        !            10:        short   f_flag;
        !            11:        short   f_count;                /* reference count */
        !            12:        struct inode *f_inode;          /* pointer to inode structure */
        !            13:        off_t   f_offset;               /* read/write character pointer */
        !            14: #ifdef CHAOS
        !            15:        caddr_t f_conn;                 /* Chaosnet connection pointer */
        !            16: #endif CHAOS
        !            17: };
        !            18: 
        !            19: #ifdef KERNEL
        !            20: struct file *file, *fileNFILE; /* the file table itself */
        !            21: int    nfile;
        !            22: 
        !            23: struct file *getf();
        !            24: struct file *falloc();
        !            25: struct file *allocfile();
        !            26: 
        !            27: /*
        !            28:  * inline to speed things up
        !            29:  */
        !            30: #define        getf(fd)        ((unsigned)(fd)>=NOFILE ? NULL : u.u_ofile[fd])
        !            31: 
        !            32: #endif
        !            33: 
        !            34: /* flags */
        !            35: #define        FREAD   01
        !            36: #define        FWRITE  02
        !            37: #define        FPIPE   04
        !            38: #define        FHUNGUP 010
        !            39: #define        FRNBLK  040     /* no block on read */
        !            40: #define        FWNBLK  0100    /* no block on write */

unix.superglobalmegacorp.com

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