]> Cypherpunks repositories - gostls13.git/commit
os: make FindProcess use pidfd on Linux
authorKir Kolyshkin <kolyshkin@gmail.com>
Thu, 16 Nov 2023 09:42:39 +0000 (01:42 -0800)
committerMichael Pratt <mpratt@google.com>
Wed, 21 Feb 2024 21:27:03 +0000 (21:27 +0000)
commitcdf3249d74c4187bc0c1737e1bb6ab1aa52c0b6f
tree1d1d02c2e659731e51349dadc12eace835631c43
parentccb6077d11e9e70cb17d3eaadaee4e673ee650c2
os: make FindProcess use pidfd on Linux

Amend FindProcess to use pidfdFind, and make it return ErrProcessDone
if pidfdFind is used and the process is not found.

Since this is a change in API, introduce GODEBUG osfinderr=0 setting
to disable the feature.

Change-Id: I724c6f622f0c99f21a70b864cf7cf2b8836869ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/542699
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
doc/godebug.md
src/internal/godebugs/table.go
src/os/exec.go
src/os/exec_unix.go
src/os/pidfd_linux.go
src/os/pidfd_other.go
src/runtime/metrics/doc.go