diff options
author | Anton Kling <anton@kling.gg> | 2024-06-26 21:34:40 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-06-26 21:34:40 +0200 |
commit | e15065fe45f8004adcc8b69bbbe680ced0d530a1 (patch) | |
tree | 19dab20babd5169a8266faf133d41a4ebd61f1f6 /kernel/syscalls/open_process.c | |
parent | 2e2f89c7508dede2c970e6061c2f66d4536162ca (diff) |
Kernel: Move all syscalls into one file
Diffstat (limited to 'kernel/syscalls/open_process.c')
-rw-r--r-- | kernel/syscalls/open_process.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/kernel/syscalls/open_process.c b/kernel/syscalls/open_process.c deleted file mode 100644 index 2acc744..0000000 --- a/kernel/syscalls/open_process.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <assert.h> -#include <errno.h> -#include <sched/scheduler.h> - -int syscall_open_process(int pid) { - // TODO: Permission check - process_t *process = (process_t *)ready_queue; - for (; process; process = process->next) { - if (pid == process->pid) { - break; - } - } - if (!process) { - return -ESRCH; - } - - vfs_inode_t *inode = vfs_create_inode( - process->pid, 0 /*type*/, 0 /*has_data*/, 0 /*can_write*/, 1 /*is_open*/, - process /*internal_object*/, 0 /*file_size*/, NULL /*open*/, - NULL /*create_file*/, NULL /*read*/, NULL /*write*/, NULL /*close*/, - NULL /*create_directory*/, NULL /*get_vm_object*/, NULL /*truncate*/, - NULL /*stat*/, process_signal, NULL /*connect*/); - int rc = vfs_create_fd(0, 0, 0, inode, NULL); - assert(rc >= 0); - return rc; -} |