xref: /original-bsd/sys/sys/file.h (revision c0a83f90)
1 /*	file.h	4.2	01/26/81	*/
2 
3 /*
4  * One file structure is allocated
5  * for each open/creat/pipe call.
6  * Main use is to hold the read/write
7  * pointer associated with each open
8  * file.
9  */
10 struct	file
11 {
12 	short	f_flag;
13 	short	f_count;		/* reference count */
14 	struct inode *f_inode;		/* pointer to inode structure */
15 	union {
16 		off_t	f_offset;	/* read/write character pointer */
17 		struct chan *f_chan;	/* mpx channel pointer */
18 #ifdef CHAOS
19 		struct connection *f_conn;
20 #endif
21 	} f_un;
22 };
23 
24 #ifdef	KERNEL
25 extern	struct file file[];		/* the file table itself */
26 
27 struct	file *getf();
28 struct	file *falloc();
29 #endif
30 
31 /* flags */
32 #define	FREAD	01
33 #define	FWRITE	02
34 #define	FPIPE	04
35 #define	FMPX	010
36 #define	FMPY	020
37 #define	FMP	030
38