From 26a78aa41d874c52427a9c2f9478f2577eff7aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 1 Dec 2004 04:26:10 +0000 Subject: [PATCH] Removed broken _user_exit(), and implemented working _user_exit_team(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10328 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/syscalls.c | 19 ++++++------------- src/kernel/core/team.c | 12 ++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/kernel/core/syscalls.c b/src/kernel/core/syscalls.c index d7bee88845..57b2c53fe6 100644 --- a/src/kernel/core/syscalls.c +++ b/src/kernel/core/syscalls.c @@ -1,15 +1,14 @@ -/* Big case statement for dispatching syscalls */ /* -** Copyright 2001, Travis Geiselbrecht. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ + * Copyright 2004, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + */ +/* Big case statement for dispatching syscalls */ #include #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include static inline @@ -41,6 +41,7 @@ _user_null() return 0; } + // map to the arch specific call static inline int64 @@ -49,14 +50,6 @@ _user_restore_signal_frame() return arch_restore_signal_frame(); } -// XXX: _kern_exit() was formerly mapped to _user_exit_thread(). That's -// probably not correct. -static inline -void -_user_exit(int returnCode) -{ - _user_exit_thread(returnCode); -} // TODO: Replace when networking code is added to the build. static inline diff --git a/src/kernel/core/team.c b/src/kernel/core/team.c index 39fd0894da..91ac8e79bc 100644 --- a/src/kernel/core/team.c +++ b/src/kernel/core/team.c @@ -2246,6 +2246,18 @@ _user_load_image(int32 argCount, const char **userArgs, int32 envCount, } +void +_user_exit_team(status_t returnValue) +{ + struct thread *thread = thread_get_current_thread(); + + thread->exit.status = returnValue; + thread->exit.reason = THREAD_RETURN_EXIT; + + send_signal(thread->id, SIGKILL); +} + + status_t _user_kill_team(team_id team) {