[PATCH] s390 sys_clone is backwards

Serge E. Hallyn serue at us.ibm.com
Mon Mar 9 12:28:38 PDT 2009


Switch the flags and sp for sys_clone for s390.

Without this, lxc-execute gets a segfault on clone (of course).
With this, it succeeds.

Signed-off-by: Serge Hallyn <serue at us.ibm.com>
---
 src/lxc/lxc_namespace.h |    4 +++-
 src/lxc/namespace.h     |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_namespace.h b/src/lxc/lxc_namespace.h
index 3bef4a8..ec51cb4 100644
--- a/src/lxc/lxc_namespace.h
+++ b/src/lxc/lxc_namespace.h
@@ -60,8 +60,10 @@
 #    error "unsupported architecture"
 #  endif
 #endif
-#if __i386__ || __x86_64__ || __s390__ || __powerpc__
+#if __i386__ || __x86_64__ || __powerpc__
 #   define fork_ns(flags) syscall(SYS_clone, flags|SIGCHLD, NULL)
+#elif __s390__
+#   define fork_ns(flags) syscall(SYS_clone, NULL, flags|SIGCHLD)
 #elif __ia64__
 #   define fork_ns(flags) syscall(SYS_clone2, flags|SIGCHLD, NULL)
 #else
diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h
index 4059368..004af4b 100644
--- a/src/lxc/namespace.h
+++ b/src/lxc/namespace.h
@@ -60,8 +60,10 @@
 #    error "unsupported architecture"
 #  endif
 #endif
-#if __i386__ || __x86_64__ || __s390__ || __powerpc__
+#if __i386__ || __x86_64__ || __powerpc__
 #   define fork_ns(flags) syscall(SYS_clone, flags|SIGCHLD, NULL);
+#elif __s390__
+#   define fork_ns(flags) syscall(SYS_clone, NULL, flags|SIGCHLD)
 #elif __ia64__
 #   define fork_ns(flags) syscall(SYS_clone2, flags|SIGCHLD, NULL);
 #else
-- 
1.6.1.1



More information about the Containers mailing list