Mercurial > hg > Members > menikon > CbC_xv6
comparison src/sysfile.c @ 24:36bd61f5c847
rewrite sys_read cbc
author | mir3636 |
---|---|
date | Thu, 17 Jan 2019 19:11:19 +0900 |
parents | 83c23a36980d |
children |
comparison
equal
deleted
inserted
replaced
23:ee58360d0e99 | 24:36bd61f5c847 |
---|---|
72 filedup(f); | 72 filedup(f); |
73 | 73 |
74 return fd; | 74 return fd; |
75 } | 75 } |
76 | 76 |
77 __code cbc_read(__code (*next)(int ret)){ | |
78 struct file *f; | |
79 int n; | |
80 char *p; | |
81 | |
82 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) { | |
83 goto next(-1); | |
84 } | |
85 goto cbc_fileread(f, p, n, next); | |
86 } | |
87 | |
77 int sys_read(void) | 88 int sys_read(void) |
78 { | 89 { |
79 struct file *f; | 90 struct file *f; |
80 int n; | 91 int n; |
81 char *p; | 92 char *p; |