summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorKen Werner <ken@linux.vnet.ibm.com>2014-12-16 18:06:41 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-12-17 00:20:56 -0500
commit60e1651a31c9c0ed1caef1a63f5e3a87156b0b1e (patch)
tree626f620b4862c64a3a2ee1d2d0a5d0ad47681f46 /src/shared
parentef686ae230c55124e3efdc7d756fb1931e10aef4 (diff)
nspawn: fix invocation of the raw clone() system call on s390 and cris
Since the order of the first and second arguments of the raw clone() system call is reversed on s390 and cris it needs to be invoked differently.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/missing.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/missing.h b/src/shared/missing.h
index c547479ad2..bea1254369 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -635,3 +635,13 @@ static inline int setns(int fd, int nstype) {
#ifndef CAP_AUDIT_READ
#define CAP_AUDIT_READ 37
#endif
+
+static inline long raw_clone(unsigned long flags, void *child_stack) {
+#if defined(__s390__) || defined(__CRIS__)
+ /* On s390 and cris the order of the first and second arguments
+ * of the raw clone() system call is reversed. */
+ return syscall(__NR_clone, child_stack, flags);
+#else
+ return syscall(__NR_clone, flags, child_stack);
+#endif
+}