Skip to contentSkip to conversation

s390 sys_clone is backwards

PATCH In review Serge E. Hallyn 2 participants 2 messages Mar 9, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390 sys_clone is backwards

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.

---
 src/lxc/lxc_namespace.h |    4 +++-
 src/lxc/namespace.h     |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
src/lxc/lxc_namespace.h +3 -1
index 3bef4a8..ec51cb4 100644
@@ -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
src/lxc/namespace.h +3 -1
index 4059368..004af4b 100644
@@ -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
Signature · 1 line
1.6.1.1

A message that is not in the archive (sent off-list or not yet received): 20090309192838.GA25727-r/[email protected]