]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-process: Define kernel internal `exit_group`
authorSergiu Moga <sergiu@unikraft.io>
Fri, 7 Feb 2025 09:54:53 +0000 (11:54 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Mon, 17 Feb 2025 13:27:26 +0000 (13:27 +0000)
Add the kernel internal variant of `exit_group`, `pprocess_exit`.
This allows kernel internal code to call this system call's logic
without having the syscall shim wrapper logic intervene.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1585

lib/posix-process/process.c

index 2a63366c4ed7e9ef329812f9ebb05108e39dd4db..d2cd45002cca7371c43a5d50d7a9b1fa7b96762f 100644 (file)
@@ -580,23 +580,28 @@ UK_LLSYSCALL_R_DEFINE(int, exit, int, status)
        return -EFAULT;
 }
 
-UK_LLSYSCALL_R_DEFINE(int, exit_group, int, status)
+static int pprocess_exit(int status __unused)
 {
        uk_posix_process_kill(uk_thread_current()); /* won't return */
        UK_CRASH("sys_exit_group() unexpectedly returned\n");
        return -EFAULT;
 }
 
+UK_LLSYSCALL_R_DEFINE(int, exit_group, int, status)
+{
+       return pprocess_exit(status);
+}
+
 #if UK_LIBC_SYSCALLS
 __noreturn void exit(int status)
 {
-       uk_syscall_r_exit_group(status);
+       pprocess_exit(status);
        UK_CRASH("sys_exit_group() unexpectedly returned\n");
 }
 
 __noreturn void exit_group(int status)
 {
-       uk_syscall_r_exit_group(status);
+       pprocess_exit(status);
        UK_CRASH("sys_exit_group() unexpectedly returned\n");
 }
 #endif /* UK_LIBC_SYSCALLS */