diff options
author | dchagin <dchagin@FreeBSD.org> | 2016-01-09 14:33:10 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2016-01-09 14:33:10 +0000 |
commit | e060fa6fed29c47a2c103ed50986230574a97223 (patch) | |
tree | b3bd9a55660bbc2caf6d88473387139eb6339e1f | |
parent | 358125d39c4e0f4ea3c19c699df945ad5d2000b6 (diff) | |
download | FreeBSD-src-e060fa6fed29c47a2c103ed50986230574a97223.zip FreeBSD-src-e060fa6fed29c47a2c103ed50986230574a97223.tar.gz |
MFC r283370:
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).
-rw-r--r-- | sys/amd64/linux32/syscalls.master | 3 | ||||
-rw-r--r-- | sys/compat/linux/linux_fork.c | 14 | ||||
-rw-r--r-- | sys/i386/linux/syscalls.master | 3 |
3 files changed, 16 insertions, 4 deletions
diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 5b39dc3..f7faa45 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -38,8 +38,7 @@ ; #ifdef's, etc. may be included, and are copied to the output files. 0 AUE_NULL UNIMPL setup -1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ - sys_exit_args void +1 AUE_EXIT STD { void linux_exit(int rval); } 2 AUE_FORK STD { int linux_fork(void); } 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ u_int nbyte); } diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index 0ab7d3a..d44b3de 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -42,6 +42,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> @@ -276,3 +277,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 */ +} diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index 5b4f3a6..62d5367 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -37,8 +37,7 @@ ; #ifdef's, etc. may be included, and are copied to the output files. 0 AUE_NULL UNIMPL setup -1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ - sys_exit_args void +1 AUE_EXIT STD { void linux_exit(int rval); } 2 AUE_FORK STD { int linux_fork(void); } 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ u_int nbyte); } |