mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-20 13:07:00 +08:00
v0.3.8
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//go:build !windows
|
||||
|
||||
package forwarder
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func processExists(pid int) bool {
|
||||
process, err := os.FindProcess(pid)
|
||||
if err != nil || process == nil {
|
||||
return false
|
||||
}
|
||||
err = process.Signal(syscall.Signal(0))
|
||||
return err == nil || errors.Is(err, syscall.EPERM)
|
||||
}
|
||||
Reference in New Issue
Block a user