Skip to content

Commit

Permalink
os/exec: document method to check if a process is alive
Browse files Browse the repository at this point in the history
  • Loading branch information
mpldr committed Jun 13, 2023
1 parent b0e1707 commit cb59f88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/os/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func Getppid() int { return syscall.Getppid() }
// about the underlying operating system process.
//
// On Unix systems, FindProcess always succeeds and returns a Process
// for the given pid, regardless of whether the process exists.
// for the given pid, regardless of whether the process exists. Whether the
// process is alive or not, can be determined by sending a 0-signal to the
// process. This fails if the process is not alive. No signal is actually sent
// to the process.
func FindProcess(pid int) (*Process, error) {
return findProcess(pid)
}
Expand Down

0 comments on commit cb59f88

Please sign in to comment.