1
0
mirror of https://github.com/golang/go synced 2024-11-23 19:30:05 -07:00

syscall: change clone argument order on s390x

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>
This commit is contained in:
Michael Munday 2016-03-18 18:55:26 -04:00 committed by Brad Fitzpatrick
parent 254d63baa7
commit cd187e9102

View 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