1 struct file { 2 enum { FD_CLOSED, FD_NONE, FD_PIPE, FD_INODE } type; 3 int ref; // reference count 4 char readable; 5 char writable; 6 struct pipe *pipe; 7 struct uinode *ip; 8 uint off; 9 }; 10