返回 DeepSeek-Reasonix
web_process_unix.go
根目录 / internal / cli / web_process_unix.go
1 //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
2
3 package cli
4
5 import (
6 "errors"
7 "syscall"
8 )
9
10 func webAddressInUse(err error) bool {
11 return errors.Is(err, syscall.EADDRINUSE)
12 }
13
14 func webInstanceProcessAlive(pid int) bool {
15 if pid <= 0 {
16 return false
17 }
18 err := syscall.Kill(pid, 0)
19 return err == nil || err == syscall.EPERM
20 }
21
21 lines GO