summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/init/fs/misc.c6
-rw-r--r--src/kernel/proc.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/init/fs/misc.c b/src/init/fs/misc.c
index 2f02e09..dc14ac4 100644
--- a/src/init/fs/misc.c
+++ b/src/init/fs/misc.c
@@ -52,10 +52,16 @@ static void fs_respond_delegate(struct fs_wait_response *res, handle_t delegate,
switch (res->op) {
case VFSOP_READ:
+ if (_syscall_fork()) {
+ // handle reads in a child
+ // this is a HORRIBLE workaround for making concurrent IO work without proper delegates
+ break;
+ }
// TODO instead of truncating the size, allocate a bigger buffer
size = res->capacity < sizeof(buf) ? res->capacity : sizeof(buf);
ret = _syscall_read(delegate, buf, size, res->offset);
_syscall_fs_respond(buf, ret);
+ _syscall_exit(0); // TODO unreapable - add a nonblocking reap syscall
break;
// TODO proper writing (see above)
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index 8e94d24..cf5bb1e 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -54,6 +54,8 @@ struct process *process_fork(struct process *parent) {
child->parent = parent;
parent->child = child;
+ parent->handled_req = NULL; // TODO control this with a flag
+
child->id = next_pid++;
return child;