aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-06-20 15:59:02 -0400
committerAustin Clements <austin@google.com>2017-06-20 21:54:19 +0000
commit87adaf4c084e0ceba6444fddaf468165e0201fa1 (patch)
treeb07b2b63497c53357fb18d025b7925153f7a5f72
parent67e537541c043c701001f002bed0cda70ce72767 (diff)
downloadgo-87adaf4c084e0ceba6444fddaf468165e0201fa1.tar.gz
go-87adaf4c084e0ceba6444fddaf468165e0201fa1.zip
syscall: mark forkAndExecInChild1 noinline
This certainly won't get inlined right now, but in the spirit of making this more robust, we have to disable inlining because inlining would defeat the purpose of separating forkAndExecInChild1 into a separate function. Updates #20732. Change-Id: I736c3f909cc42c5f5783740c2e19ba4827c7c2ec Reviewed-on: https://go-review.googlesource.com/46174 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--src/syscall/exec_linux.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go
index db52360717..5cbabf7896 100644
--- a/src/syscall/exec_linux.go
+++ b/src/syscall/exec_linux.go
@@ -90,6 +90,15 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
return pid, 0
}
+// forkAndExecInChild1 implements the body of forkAndExecInChild up to
+// the parent's post-fork path. This is a separate function so we can
+// separate the child's and parent's stack frames if we're using
+// vfork.
+//
+// This is go:noinline because the point is to keep the stack frames
+// of this and forkAndExecInChild separate.
+//
+//go:noinline
//go:norace
func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (r1 uintptr, err1 Errno, p [2]int, locked bool) {
// vfork requires that the child not touch any of the parent's