summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_fork.c
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2015-05-24 14:33:19 +0000
committerdchagin <dchagin@FreeBSD.org>2015-05-24 14:33:19 +0000
commitcd30334c97969f526c2ce39023a8bc7e152908c0 (patch)
tree34578887bd71f1a242552c3fbd6b65af1a10a6e6 /sys/compat/linux/linux_fork.c
parentadb3a300b37fc1f29bd600f0301746410f95ddd3 (diff)
downloadFreeBSD-src-cd30334c97969f526c2ce39023a8bc7e152908c0.zip
FreeBSD-src-cd30334c97969f526c2ce39023a8bc7e152908c0.tar.gz
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
Diffstat (limited to 'sys/compat/linux/linux_fork.c')
-rw-r--r--sys/compat/linux/linux_fork.c14
1 files changed, 14 insertions, 0 deletions
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 <sys/sdt.h>
#include <sys/sx.h>
#include <sys/unistd.h>
+#include <sys/wait.h>
#ifdef COMPAT_LINUX32
#include <machine/../linux32/linux.h>
@@ -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 */
+}
OpenPOWER on IntegriCloud