[Devel] Re: [PATCH 3/9] user-cr: s390 eclone wrapper

Serge E. Hallyn serue at us.ibm.com
Tue Nov 17 19:23:33 PST 2009


Quoting Nathan Lynch (ntl at pobox.com):
> Based on original work from Serge Hallyn.

Needed the following patch on top of that.  Otherwise the
whole set looks good to me, thanks!

(Oh, one other note, the default #ifdef for NR_eclone actually
is different depending on whether we're on a c/r kernel or not,
unfortunately :(.  I'm leaving it as the non-c/r kernel value
for now.)

thanks,
-serge

From: "Serge E. Hallyn" <serue at us.ibm.com>
Subject: [PATCH 1/1] a few bugfixes for s390

Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
---
 clone_s390x.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/clone_s390x.c b/clone_s390x.c
index af3d41f..64d4436 100644
--- a/clone_s390x.c
+++ b/clone_s390x.c
@@ -34,7 +34,7 @@ typedef unsigned long long u64;
 
 #define do_eclone(flags, pids, args, sz) \
 ( { \
-  register unsigned long int __r1 asm ("1") = (unsigned long int)(__NR_eclone); 
+  register unsigned long int __r1 asm ("1") = (unsigned long int)(__NR_eclone);  \
   register unsigned long int __r2 asm ("2") = (unsigned long int)(flags); \
   register unsigned long int __r3 asm ("3") = (unsigned long int)(args); \
   register unsigned long int __r4 asm ("4") = (unsigned long int)(sz); \
@@ -77,9 +77,10 @@ int eclone(int (*fn)(void *), void *fn_arg, int clone_flags_low,
 	my_args.child_stack = (unsigned long)child_sp;
 	my_args.child_stack_size = 0;
 
-	rc = do_eclone(flags, pids, &my_args, sizeof(struct clone_args));
+	rc = do_eclone(clone_flags_low, pids, &my_args,
+			sizeof(struct clone_args));
 	if (rc < 0) {
-		errno = rc;
+		errno = -rc;
 		rc = -1;
 	}
 
-- 
1.6.1.1

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list