mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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:
parent
254d63baa7
commit
cd187e9102
1 changed files with 6 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
package syscall
|
package syscall
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -93,7 +94,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
|
||||||
// About to call fork.
|
// About to call fork.
|
||||||
// No more allocation or calls of non-assembly functions.
|
// No more allocation or calls of non-assembly functions.
|
||||||
runtime_BeforeFork()
|
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 {
|
if err1 != 0 {
|
||||||
runtime_AfterFork()
|
runtime_AfterFork()
|
||||||
return 0, err1
|
return 0, err1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue