返回 DeepSeek-Reasonix
process_alive_other.go
根目录 / desktop / process_alive_other.go
1 //go:build !windows
2
3 package main
4
5 import "syscall"
6
7 func desktopProcessAlive(pid int) bool {
8 if pid <= 0 {
9 return false
10 }
11 err := syscall.Kill(pid, 0)
12 return err == nil || err == syscall.EPERM
13 }
14
14 lines GO