]> Cypherpunks repositories - gostls13.git/commitdiff
os: explain ProccessState.Exited() SIGKILL interaction
authorForest Johnson <forest.n.johnson@gmail.com>
Fri, 8 Oct 2021 19:03:35 +0000 (19:03 +0000)
committerAlexander Rakoczy <alex@golang.org>
Wed, 13 Oct 2021 15:56:29 +0000 (15:56 +0000)
When a process is forcefully killed (for example, with SIGKILL on unix), its ProccessState.Exited() will return false.

Change-Id: I8cebc8d28f2ba1b687c145f6d941647fc3a10665
GitHub-Last-Rev: 414ae1980fe61dd530c46cc2c7f4de3a5bc83ed5
GitHub-Pull-Request: golang/go#48871
Reviewed-on: https://go-review.googlesource.com/c/go/+/354698
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

src/os/exec.go

index bc75d4dd66c9103ccf27df5729baa074d4fa0cdd..2beac55f89b67a31cdb654855ae84ce719b41076 100644 (file)
@@ -149,6 +149,8 @@ func (p *ProcessState) SystemTime() time.Duration {
 }
 
 // Exited reports whether the program has exited.
+// On Unix systems this reports true if the program exited due to calling exit,
+// but false if the program terminated due to a signal.
 func (p *ProcessState) Exited() bool {
        return p.exited()
 }