1 Star 0 Fork 0

docker-mirror / docker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
process_unix.go 465 Bytes
一键复制 编辑 原始数据 按行查看 历史
lilongyu 提交于 2020-10-09 11:30 . Initial commit
// +build linux freebsd darwin
package system // import "github.com/docker/docker/pkg/system"
import (
"syscall"
"golang.org/x/sys/unix"
)
// IsProcessAlive returns true if process with a given pid is running.
func IsProcessAlive(pid int) bool {
err := unix.Kill(pid, syscall.Signal(0))
if err == nil || err == unix.EPERM {
return true
}
return false
}
// KillProcess force-stops a process.
func KillProcess(pid int) {
unix.Kill(pid, unix.SIGKILL)
}
1
https://gitee.com/docker-mirror/docker.git
git@gitee.com:docker-mirror/docker.git
docker-mirror
docker
docker
3e752258994c

搜索帮助