diff options
author | dzwdz | 2021-09-09 21:14:26 +0200 |
---|---|---|
committer | dzwdz | 2021-09-09 21:14:26 +0200 |
commit | 80b2c1c2ab36b4ddb030e135bcacf1f30db362d2 (patch) | |
tree | 50eaf0a30fb296a21f24254575b4d6bbb52c95f1 /src/init/main.c | |
parent | 7192887ee27487d209b98b7192cb6798b036b824 (diff) |
basic _syscall_fs_wait() impl, doesn't pass the req yet
Diffstat (limited to 'src/init/main.c')
-rw-r--r-- | src/init/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/init/main.c b/src/init/main.c index 41f51d3..8d677af 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -30,8 +30,18 @@ int main(void) { void fs_test(void) { handle_t front, back, file; front = _syscall_fs_create((void*)&back); // TODO change user_ptr to void* - _syscall_mount(front, argify("/mnt")); - file = _syscall_open(argify("/mnt/test")); + + if (_syscall_fork()) { + // child: is the fs server + log("fs_wait started. "); + _syscall_fs_wait(back, NULL); + log("fs_wait returned. "); + } else { + // parent: accesses the fs + _syscall_mount(front, argify("/mnt")); + log("requesting file. "); + file = _syscall_open(argify("/mnt/test")); + } } void misc_tests(void) { |