Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux implement basic exit_group(2), which just t...



details:   https://anonhg.NetBSD.org/src/rev/5ba8b58a50f5
branches:  trunk
changeset: 569834:5ba8b58a50f5
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Sep 08 19:45:21 2004 +0000

description:
implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now

diffstat:

 sys/compat/linux/arch/alpha/syscalls.master   |   4 +-
 sys/compat/linux/arch/arm/syscalls.master     |   4 +-
 sys/compat/linux/arch/i386/syscalls.master    |   4 +-
 sys/compat/linux/arch/mips/syscalls.master    |   4 +-
 sys/compat/linux/arch/powerpc/syscalls.master |   4 +-
 sys/compat/linux/common/linux_sched.c         |  30 +++++++++++++++++++++++++-
 6 files changed, 38 insertions(+), 12 deletions(-)

diffs (145 lines):

diff -r 457793c196f1 -r 5ba8b58a50f5 sys/compat/linux/arch/alpha/syscalls.master
--- a/sys/compat/linux/arch/alpha/syscalls.master       Wed Sep 08 19:41:24 2004 +0000
+++ b/sys/compat/linux/arch/alpha/syscalls.master       Wed Sep 08 19:45:21 2004 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.45 2004/08/01 15:36:23 jdolecek Exp $
+       $NetBSD: syscalls.master,v 1.46 2004/09/08 19:45:21 jdolecek Exp $
 ;
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -631,7 +631,7 @@
 402    UNIMPL          io_cancel
 403    UNIMPL          /* unused */
 404    UNIMPL          /* unused */
-405    UNIMPL          exit_group
+405    STD             { int linux_sys_exit_group(int error_code); }
 406    UNIMPL          lookup_dcookie
 407    UNIMPL          sys_epoll_create
 408    UNIMPL          sys_epoll_ctl
diff -r 457793c196f1 -r 5ba8b58a50f5 sys/compat/linux/arch/arm/syscalls.master
--- a/sys/compat/linux/arch/arm/syscalls.master Wed Sep 08 19:41:24 2004 +0000
+++ b/sys/compat/linux/arch/arm/syscalls.master Wed Sep 08 19:45:21 2004 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.17 2004/08/01 14:16:32 jdolecek Exp $
+       $NetBSD: syscalls.master,v 1.18 2004/09/08 19:45:22 jdolecek Exp $
 
 ; Derived from sys/compat/linux/arch/*/syscalls.master
 ; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -402,7 +402,7 @@
 245    UNIMPL          io_getevents
 246    UNIMPL          io_submit
 247    UNIMPL          io_cancel
-248    UNIMPL          exit_group
+248    STD             { int linux_sys_exit_group(int error_code); }
 249    UNIMPL          lookup_dcookie
 250    UNIMPL          epoll_create
 251    UNIMPL          epoll_ctl
diff -r 457793c196f1 -r 5ba8b58a50f5 sys/compat/linux/arch/i386/syscalls.master
--- a/sys/compat/linux/arch/i386/syscalls.master        Wed Sep 08 19:41:24 2004 +0000
+++ b/sys/compat/linux/arch/i386/syscalls.master        Wed Sep 08 19:45:21 2004 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.69 2004/08/01 15:34:22 jdolecek Exp $
+       $NetBSD: syscalls.master,v 1.70 2004/09/08 19:45:22 jdolecek Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -400,7 +400,7 @@
 249    UNIMPL          io_cancel
 250    UNIMPL          fadvise64
 251    UNIMPL          /* unused */
-252    UNIMPL          exit_group
+252    STD             { int linux_sys_exit_group(int error_code); }
 253    UNIMPL          lookup_dcookie
 254    UNIMPL          epoll_create
 255    UNIMPL          epoll_ctl
diff -r 457793c196f1 -r 5ba8b58a50f5 sys/compat/linux/arch/mips/syscalls.master
--- a/sys/compat/linux/arch/mips/syscalls.master        Wed Sep 08 19:41:24 2004 +0000
+++ b/sys/compat/linux/arch/mips/syscalls.master        Wed Sep 08 19:45:21 2004 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.14 2004/08/01 15:34:22 jdolecek Exp $  
+       $NetBSD: syscalls.master,v 1.15 2004/09/08 19:45:22 jdolecek Exp $  
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -411,7 +411,7 @@
 243    UNIMPL          io_getevents
 244    UNIMPL          io_submit
 245    UNIMPL          io_cancel
-246    UNIMPL          exit_group
+246    STD             { int linux_sys_exit_group(int error_code); }
 247    UNIMPL          lookup_dcookie
 248    UNIMPL          epoll_create
 249    UNIMPL          epoll_ctl
diff -r 457793c196f1 -r 5ba8b58a50f5 sys/compat/linux/arch/powerpc/syscalls.master
--- a/sys/compat/linux/arch/powerpc/syscalls.master     Wed Sep 08 19:41:24 2004 +0000
+++ b/sys/compat/linux/arch/powerpc/syscalls.master     Wed Sep 08 19:45:21 2004 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.18 2004/08/01 15:34:22 jdolecek Exp $  
+       $NetBSD: syscalls.master,v 1.19 2004/09/08 19:45:22 jdolecek Exp $  
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -403,7 +403,7 @@
 231    UNIMPL          io_cancel
 232    UNIMPL          set_tid_address
 233    UNIMPL          fadvise64
-234    UNIMPL          exit_group
+234    STD             { int linux_sys_exit_group(int error_code); }
 235    UNIMPL          lookup_dcookie
 236    UNIMPL          epoll_create
 237    UNIMPL          epoll_ctl
diff -r 457793c196f1 -r 5ba8b58a50f5 sys/compat/linux/common/linux_sched.c
--- a/sys/compat/linux/common/linux_sched.c     Wed Sep 08 19:41:24 2004 +0000
+++ b/sys/compat/linux/common/linux_sched.c     Wed Sep 08 19:45:21 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_sched.c,v 1.13 2004/09/08 19:41:24 jdolecek Exp $        */
+/*     $NetBSD: linux_sched.c,v 1.14 2004/09/08 19:45:22 jdolecek Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.13 2004/09/08 19:41:24 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.14 2004/09/08 19:45:22 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -50,6 +50,7 @@
 #include <sys/systm.h>
 #include <sys/sa.h>
 #include <sys/syscallargs.h>
+#include <sys/wait.h>
 
 #include <machine/cpu.h>
 
@@ -340,3 +341,28 @@
        *retval = 0;
        return 0;
 }
+
+#ifndef __m68k__
+/* Present on everything but m68k */
+int
+linux_sys_exit_group(l, v, retval)
+       struct lwp *l;
+       void *v;
+       register_t *retval;
+{
+       struct linux_sys_exit_group_args /* {
+               syscallarg(int) error_code;
+       } */ *uap = v;
+
+       /*
+        * XXX The calling thread is supposed to kill all threads
+        * in the same thread group (i.e. all threads created
+        * via clone(2) with CLONE_THREAD flag set). This appears
+        * to not be used yet, so the thread group handling
+        * is currenly not implemented.
+        */
+
+       exit1(l, W_EXITCODE(SCARG(uap, error_code), 0));
+       /* NOTREACHED */
+}
+#endif /* !__m68k__ */



Home | Main Index | Thread Index | Old Index