#sccs "@(#)uts/kern/sys:file.h 1.1" /* Convergent Technologies - System V - May 1983 */ #ifndef file_h #define file_h #include #include /* * 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 */ union { struct inode *f_uinode; /* pointer to inode structure */ struct file *f_unext; /* next entry in freelist */ } f_up; off_t f_offset; /* read/write character pointer */ }; #define f_inode f_up.f_uinode #define f_next f_up.f_unext extern struct file *file; /* The file table itself */ extern struct file *ffreelist; /* Head of freelist pool */ /* flags */ #define FOPEN (-1) #define FREAD 00001 /* open for read */ #define FWRITE 00002 /* open for write */ #define FNDELAY 00004 /* delay bit */ #define FAPPEND 00010 /* append mode */ #define FSYNC 00020 #define FMASK 00377 /* mask */ /* open only modes */ #define FCREAT 00400 #define FTRUNC 01000 #define FEXCL 02000 #define FMOUNT 04000 #define FINODE 040000 /* Inode open */ #endif