From cd30334c97969f526c2ce39023a8bc7e152908c0 Mon Sep 17 00:00:00 2001 From: dchagin Date: Sun, 24 May 2015 14:33:19 +0000 Subject: In preparation for switching linuxulator to the use the native 1:1 threads introduce linux_exit() stub instead of sys_exit() call (which terminates process). In the new linuxulator exit() system call terminates the calling thread (not a whole process). Differential Revision: https://reviews.freebsd.org/D1027 Reviewed by: trasz --- sys/compat/linux/linux_fork.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sys/compat/linux/linux_fork.c') diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index 316cf2a..c951c8f 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef COMPAT_LINUX32 #include @@ -297,3 +298,16 @@ linux_clone(struct thread *td, struct linux_clone_args *args) return (0); } + +int +linux_exit(struct thread *td, struct linux_exit_args *args) +{ + +#ifdef DEBUG + if (ldebug(exit)) + printf(ARGS(exit, "%d"), args->rval); +#endif + + exit1(td, W_EXITCODE(args->rval, 0)); + /* NOTREACHED */ +} -- cgit v1.1