diff options
| author | Rémy Oudompheng <oudomphe@phare.normalesup.org> | 2013-08-24 03:34:07 +0200 |
|---|---|---|
| committer | Rémy Oudompheng <oudomphe@phare.normalesup.org> | 2013-08-24 03:34:07 +0200 |
| commit | 534c67abc425bc18ee95163c2266c1416b6f12c1 (patch) | |
| tree | 34cd247233d6c10611a82d9aee94ffe92e5bad18 /src/pkg/syscall/exec_linux.go | |
| parent | d0dd420a245763494ec564d8163724a2a6d374f4 (diff) | |
| download | go-534c67abc425bc18ee95163c2266c1416b6f12c1.tar.xz | |
syscall: add Cloneflags to Linux SysProcAttr.
Also use clone(2) syscall instead of fork().
Fixes #6214.
R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/13159044
Diffstat (limited to 'src/pkg/syscall/exec_linux.go')
| -rw-r--r-- | src/pkg/syscall/exec_linux.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/syscall/exec_linux.go b/src/pkg/syscall/exec_linux.go index f332b7069c..81dc80800b 100644 --- a/src/pkg/syscall/exec_linux.go +++ b/src/pkg/syscall/exec_linux.go @@ -20,6 +20,7 @@ type SysProcAttr struct { Noctty bool // Detach fd 0 from controlling terminal Ctty int // Controlling TTY fd (Linux only) Pdeathsig Signal // Signal that the process will get when its parent dies (Linux only) + Cloneflags uintptr // Flags for clone calls (Linux only) } // Implemented in runtime package. @@ -61,7 +62,7 @@ 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 = RawSyscall(SYS_FORK, 0, 0, 0) + r1, _, err1 = RawSyscall6(SYS_CLONE, uintptr(SIGCHLD)|sys.Cloneflags, 0, 0, 0, 0, 0) if err1 != 0 { runtime_AfterFork() return 0, err1 |
