From c4e4afc90eb6fd31710edb062bacfae0643d170f Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 23 Feb 2024 13:07:11 -0500 Subject: Revert "os: make FindProcess use pidfd on Linux" This reverts CL 542699. Reason for revert: Some applications assume FindProcess does not return errors. For #62654. Fixes #65866. Change-Id: Ic185a6253c8e508b08150b618c39a9905f6cdd60 Reviewed-on: https://go-review.googlesource.com/c/go/+/566476 Reviewed-by: Bryan Mills LUCI-TryBot-Result: Go LUCI Auto-Submit: Michael Pratt --- src/os/exec.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/os/exec.go') diff --git a/src/os/exec.go b/src/os/exec.go index 7ef1fee595..42e8a399a9 100644 --- a/src/os/exec.go +++ b/src/os/exec.go @@ -86,17 +86,10 @@ func Getppid() int { return syscall.Getppid() } // The Process it returns can be used to obtain information // about the underlying operating system process. // -// On Unix systems other than Linux, FindProcess always succeeds and returns a Process +// On Unix systems, FindProcess always succeeds and returns a Process // for the given pid, regardless of whether the process exists. To test whether // the process actually exists, see whether p.Signal(syscall.Signal(0)) reports // an error. -// -// On Linux, FindProcess may either return ErrProcessGone for a non-existing -// process (thus eliminating the need to use a signal to check if the process -// exists), or work the same way as for other Unix systems, described above, -// depending on the kernel version used and the system configuration. The old -// behavior (of always succeeding) can be enforced by using GODEBUG setting -// osfinderr=0. func FindProcess(pid int) (*Process, error) { return findProcess(pid) } -- cgit v1.3