]> Cypherpunks repositories - gostls13.git/commit
syscall: only get parent PID if SysProcAttr.Pdeathsig is set
authorTobias Klauser <tklauser@distanz.ch>
Tue, 26 Aug 2025 12:04:14 +0000 (14:04 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 28 Aug 2025 08:56:41 +0000 (01:56 -0700)
commitebc763f76d1151d8aa3ac1b894b08527999a4938
treee00541f495e9ca362ed0b4c97317f39bea50596c
parent7f1864b0a819c58ef55739189a57f1944c544baf
syscall: only get parent PID if SysProcAttr.Pdeathsig is set

The value of the parent PID is only used to check against get value
returned by getppid(2) in case SysProcAttr.Pdeathsig is non-zero. Avoid
the useless getpid(2) system call otherwise.

Cq-Include-Trybots: luci.golang.try:gotip-freebsd-amd64
Change-Id: If89f9c7acc82016ec359c79bd861d41460f42218
Reviewed-on: https://go-review.googlesource.com/c/go/+/699175
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
src/syscall/exec_freebsd.go
src/syscall/exec_linux.go