Mercurial > hg > Members > tobaru > CbC_xv6
diff src/sysfile.cbc @ 88:f38d8d39d617
add file interface
author | tobaru |
---|---|
date | Wed, 16 Oct 2019 19:40:37 +0900 |
parents | 214d21c891c7 |
children | b5ddf6fb0a6d |
line wrap: on
line diff
--- a/src/sysfile.cbc Tue Oct 15 20:13:25 2019 +0900 +++ b/src/sysfile.cbc Wed Oct 16 19:40:37 2019 +0900 @@ -87,6 +87,20 @@ goto cbc_fileread(f, p, n, next); } +__code file_read(struct file *f, int n, char *p, __code next(...)){ + goto cbc_fileread(f, p, n, next); +} + +__code file_read_stub(struct Context* cbc_context){ + struct file *f; + int n; + char *p; + if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) { + goto next(-1); + } + goto cbc_fileread(f, p, n, next); +} + int sys_read(void) { struct file *f;