Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Feb 2013 07:55:27 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r247169 - in user/dchagin/lemul/sys: amd64/linux32 compat/linux i386/linux
Message-ID:  <201302230755.r1N7tR2Q010743@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Feb 23 07:55:27 2013
New Revision: 247169
URL: http://svnweb.freebsd.org/changeset/base/247169

Log:
      In preparation for switching linuxulator to the use the native 1:1 threads
      introduce linux_exit() stub instead of calling sys_exit()
      call (which terminates process).
      In the new linuxulator exit() system call terminates the
      calling thread (not a whole process).

Modified:
  user/dchagin/lemul/sys/amd64/linux32/syscalls.master
  user/dchagin/lemul/sys/compat/linux/linux_fork.c
  user/dchagin/lemul/sys/i386/linux/syscalls.master

Modified: user/dchagin/lemul/sys/amd64/linux32/syscalls.master
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/syscalls.master	Sat Feb 23 07:51:33 2013	(r247168)
+++ user/dchagin/lemul/sys/amd64/linux32/syscalls.master	Sat Feb 23 07:55:27 2013	(r247169)
@@ -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); }

Modified: user/dchagin/lemul/sys/compat/linux/linux_fork.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_fork.c	Sat Feb 23 07:51:33 2013	(r247168)
+++ user/dchagin/lemul/sys/compat/linux/linux_fork.c	Sat Feb 23 07:55:27 2013	(r247169)
@@ -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>
@@ -298,3 +299,16 @@ linux_clone(struct thread *td, struct li
 
 	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 */
+}

Modified: user/dchagin/lemul/sys/i386/linux/syscalls.master
==============================================================================
--- user/dchagin/lemul/sys/i386/linux/syscalls.master	Sat Feb 23 07:51:33 2013	(r247168)
+++ user/dchagin/lemul/sys/i386/linux/syscalls.master	Sat Feb 23 07:55:27 2013	(r247169)
@@ -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); }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302230755.r1N7tR2Q010743>