From 25fea2b2d8942f0ea8a26d0f5407090091289a3b Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Tue, 29 Oct 2019 14:11:41 +0900 Subject: [PATCH] Call process_exit() from sys_exit() --- kernel/core/posixcall.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kernel/core/posixcall.c b/kernel/core/posixcall.c index 7223ed3..7e0ca4c 100644 --- a/kernel/core/posixcall.c +++ b/kernel/core/posixcall.c @@ -5,10 +5,21 @@ #include #include #include +#include int sys_exit(int status) { - return(-ENOSYS); + process_t *proc; + int ret_val; + + proc = process_get_current(); + ret_val = -EFAULT; + + if(proc) { + ret_val = process_exit(proc, status); + } + + return(ret_val); } int sys_fork(void) -- 2.47.3