]> git.hungrycats.org Git - linux/commitdiff
[PATCH] uml: fix call to sys_clone
authorJeff Dike <jdike@addtoit.com>
Fri, 17 Sep 2004 05:12:33 +0000 (22:12 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 17 Sep 2004 05:12:33 +0000 (22:12 -0700)
This patch changes the calling convention of clone on i386 to match that of
the host by leaving the fourth argument unused.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/kernel/syscall_kern.c
arch/um/sys-i386/syscalls.c

index ba427339e3538b2df4031b39deaa36951bede421..6d0912b9957c9ed917eee0199b127fdfddcc84be 100644 (file)
@@ -44,17 +44,6 @@ long sys_fork(void)
        return(ret);
 }
 
-long sys_clone(unsigned long clone_flags, unsigned long newsp,
-              int *parent_tid, int *child_tid)
-{
-       long ret;
-
-       current->thread.forking = 1;
-       ret = do_fork(clone_flags, newsp, NULL, 0, parent_tid, child_tid);
-       current->thread.forking = 0;
-       return(ret);
-}
-
 long sys_vfork(void)
 {
        long ret;
index 751549bd7f45aba38502f40199d8990add8cd3c7..6ad31749bfe72133957a89002771549b6a8afb66 100644 (file)
@@ -3,6 +3,7 @@
  * Licensed under the GPL
  */
 
+#include "linux/sched.h"
 #include "asm/mman.h"
 #include "asm/uaccess.h"
 #include "asm/unistd.h"
@@ -56,6 +57,27 @@ int old_select(struct sel_arg_struct *arg)
        return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
 }
 
+/* The i386 version skips reading from %esi, the fourth argument. So we must do
+ * this, too.
+ */
+int sys_clone(unsigned long clone_flags, unsigned long newsp, int *parent_tid,
+             int unused, int *child_tid)
+{
+       long ret;
+
+       /* XXX: normal arch do here this pass, and also pass the regs to
+        * do_fork, instead of NULL. Currently the arch-independent code
+        * ignores these values, while the UML code (actually it's
+        * copy_thread) does the right thing. But this should change,
+        probably. */
+       /*if (!newsp)
+               newsp = UPT_SP(current->thread.regs);*/
+       current->thread.forking = 1;
+       ret = do_fork(clone_flags, newsp, NULL, 0, parent_tid, child_tid);
+       current->thread.forking = 0;
+       return(ret);
+}
+
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically