summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
authordzwdz2021-09-12 17:53:48 +0200
committerdzwdz2021-09-12 17:53:48 +0200
commit3ea9657aaaf02709c8f216285b095af29e76491c (patch)
tree36dfe7038f2ff829791ccdaf18b0ee71744207a6 /src/kernel/syscalls.c
parent5090829984cd4b3238d3f42eaad2431f1fd5282b (diff)
implement part of `fs_respond`
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 1180197..b247619 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -222,6 +222,17 @@ int _syscall_fs_wait(handle_t back, char __user *buf, int __user *len) {
}
}
+int _syscall_fs_respond(int ret, char __user *buf, int len) {
+ struct vfs_request *req = process_current->handled_req;
+ if (!req) return -1;
+
+ // TODO copy buffer
+
+ process_current->handled_req = NULL;
+ vfs_request_finish(req, ret);
+ return 0;
+}
+
int _syscall_memflag(void __user *addr, size_t len, int flags) {
userptr_t goal = addr + len;
struct pagedir *pages = process_current->pages;
@@ -263,6 +274,8 @@ int syscall_handler(int num, int a, int b, int c) {
return _syscall_fs_create((userptr_t)a);
case _SYSCALL_FS_WAIT:
return _syscall_fs_wait(a, (userptr_t)b, (userptr_t)c);
+ case _SYSCALL_FS_RESPOND:
+ return _syscall_fs_respond(a, (userptr_t)b, c);
case _SYSCALL_MEMFLAG:
return _syscall_memflag((userptr_t)a, b, c);
default: