|
|
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: Long f_offset; /* read/write character pointer */ ! 14: }; ! 15: ! 16: #ifdef KERNEL ! 17: extern struct file file[]; ! 18: extern struct file *fileNFILE; ! 19: extern int filecnt; ! 20: ! 21: struct file *falloc(); ! 22: struct file *allocfile(); ! 23: ! 24: /* ! 25: * inline to speed things up ! 26: */ ! 27: #define getf(fd) ((unsigned)(fd)>=NOFILE ? NULL : u.u_ofile[fd]) ! 28: ! 29: #endif ! 30: ! 31: /* flags */ ! 32: #define FREAD 01 ! 33: #define FWRITE 02 ! 34: #define FPIPE 04 ! 35: #define FHUNGUP 010 ! 36: #define FRNBLK 040 /* no block on read */ ! 37: #define FWNBLK 0100 /* no block on write */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.