/* * One file structure is allocated for each open/creat/pipe call. * Main use is to hold the read/write pointer associated with * each open file. */ struct file { char f_flag; cnt_t f_count; /* reference count */ struct inode *f_inode; /* pointer to inode structure */ union { off_t f_off; /* read/write character pointer */ } f_un; }; #define f_offset f_un.f_off extern struct file file[]; /* The file table itself */ /* flags */ #define FOPEN (-1) #define FREAD 0x01 #define FWRITE 0x02 #define FNDELAY 0x04 #define FAPPEND 0x08 #define FMASK 0xFF /* open only modes */ #define FCREAT 0x100 #define FTRUNC 0x200 #define FEXCL 0x400