17 lines
270 B
Go
17 lines
270 B
Go
//go:build !windows
|
|
|
|
package pi
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func processAlive(pid int) bool {
|
|
process, err := os.FindProcess(pid)
|
|
if err != nil { return false }
|
|
err = process.Signal(syscall.Signal(0))
|
|
return err == nil || errors.Is(err, syscall.EPERM)
|
|
}
|