Mercurial > hg > Members > anatofuz > CbC_xv6
comparison src/sysfile.cbc @ 88:f38d8d39d617
add file interface
author | tobaru |
---|---|
date | Wed, 16 Oct 2019 19:40:37 +0900 |
parents | 214d21c891c7 |
children | b5ddf6fb0a6d |
comparison
equal
deleted
inserted
replaced
87:add5e775339c | 88:f38d8d39d617 |
---|---|
85 goto next(-1); | 85 goto next(-1); |
86 } | 86 } |
87 goto cbc_fileread(f, p, n, next); | 87 goto cbc_fileread(f, p, n, next); |
88 } | 88 } |
89 | 89 |
90 __code file_read(struct file *f, int n, char *p, __code next(...)){ | |
91 goto cbc_fileread(f, p, n, next); | |
92 } | |
93 | |
94 __code file_read_stub(struct Context* cbc_context){ | |
95 struct file *f; | |
96 int n; | |
97 char *p; | |
98 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) { | |
99 goto next(-1); | |
100 } | |
101 goto cbc_fileread(f, p, n, next); | |
102 } | |
103 | |
90 int sys_read(void) | 104 int sys_read(void) |
91 { | 105 { |
92 struct file *f; | 106 struct file *f; |
93 int n; | 107 int n; |
94 char *p; | 108 char *p; |