diff options
Diffstat (limited to 'src/pkg/syscall/exec_linux.go')
| -rw-r--r-- | src/pkg/syscall/exec_linux.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pkg/syscall/exec_linux.go b/src/pkg/syscall/exec_linux.go index 934c657712..f332b7069c 100644 --- a/src/pkg/syscall/exec_linux.go +++ b/src/pkg/syscall/exec_linux.go @@ -22,6 +22,10 @@ type SysProcAttr struct { Pdeathsig Signal // Signal that the process will get when its parent dies (Linux only) } +// Implemented in runtime package. +func runtime_BeforeFork() +func runtime_AfterFork() + // Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child. // If a dup or exec fails, write the errno error to pipe. // (Pipe is close-on-exec so if exec succeeds, it will be closed.) @@ -56,13 +60,16 @@ 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) if err1 != 0 { + runtime_AfterFork() return 0, err1 } if r1 != 0 { // parent; return PID + runtime_AfterFork() return int(r1), 0 } |
