Mercurial > hg > Members > menikon > CbC_xv6
view src/interface/file.dg @ 201:b73c5bd61c37
merge
author | menikon <e165723@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 23 Jan 2020 01:55:03 +0900 |
parents | 14aa35b56347 |
children | a7fc5edea925 |
line wrap: on
line source
typedef struct file <Impl> { union Data* file; enum { FD_NONE, FD_PIPE, FD_INODE } type; int ref; // reference count char readable; char writable; struct pipe *pipe; struct inode *ip; unsigned int off; struct stat* st; char* addr; int n; int fd; __code read(Impl* file, char* addr, __code next(...)); __code write(Impl* file, char* addr, int n, __code next(...)); __code close(Impl* file,int fd, __code next(...)); } file;