]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: change clone argument order on s390x
authorMichael Munday <munday@ca.ibm.com>
Fri, 18 Mar 2016 22:55:26 +0000 (18:55 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 21 Mar 2016 08:59:18 +0000 (08:59 +0000)
The Linux ABI takes arguments in a different order on s390x.

Change-Id: Ic9cfcc22a5ea3d8ef77d4dd0b915fc266ff3e5f7
Reviewed-on: https://go-review.googlesource.com/20960
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

src/syscall/exec_linux.go

index 0ea9283bf680d6b2a06eb99c9b3a677120895e76..c1fd53cc6ec8a17a23633fe574f934148b85323e 100644 (file)
@@ -7,6 +7,7 @@
 package syscall
 
 import (
+       "runtime"
        "unsafe"
 )
 
@@ -93,7 +94,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
        // About to call fork.
        // No more allocation or calls of non-assembly functions.
        runtime_BeforeFork()
-       r1, _, err1 = RawSyscall6(SYS_CLONE, uintptr(SIGCHLD)|sys.Cloneflags, 0, 0, 0, 0, 0)
+       if runtime.GOARCH == "s390x" {
+               r1, _, err1 = RawSyscall6(SYS_CLONE, 0, uintptr(SIGCHLD)|sys.Cloneflags, 0, 0, 0, 0)
+       } else {
+               r1, _, err1 = RawSyscall6(SYS_CLONE, uintptr(SIGCHLD)|sys.Cloneflags, 0, 0, 0, 0, 0)
+       }
        if err1 != 0 {
                runtime_AfterFork()
                return 0, err1