From 3ee8c3cc0b1053f4122f0e20d657b8255ad6a102 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 26 Jan 2018 13:44:28 -0500 Subject: os: document inheritance of thread state over exec Fixes #23570. Change-Id: I462ada2960d710c2c94dc22a59d292703d83f612 Reviewed-on: https://go-review.googlesource.com/90255 Reviewed-by: Russ Cox --- src/os/exec/exec.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/os/exec/exec.go') diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go index 8a49fe3b58..5ef9540141 100644 --- a/src/os/exec/exec.go +++ b/src/os/exec/exec.go @@ -293,6 +293,11 @@ func (c *Cmd) closeDescriptors(closers []io.Closer) { // // If the command starts but does not complete successfully, the error is of // type *ExitError. Other error types may be returned for other situations. +// +// If the calling goroutine has locked the operating system thread +// with runtime.LockOSThread and modified any inheritable OS-level +// thread state (for example, Linux or Plan 9 name spaces), the new +// process will inherit the caller's thread state. func (c *Cmd) Run() error { if err := c.Start(); err != nil { return err -- cgit v1.3-5-g9baa