github.com/kaisenlinux/docker@v0.0.0-20230510090727-ea55db55fac7/engine/pkg/system/process_windows.go (about) 1 package system // import "github.com/docker/docker/pkg/system" 2 3 import "os" 4 5 // IsProcessAlive returns true if process with a given pid is running. 6 func IsProcessAlive(pid int) bool { 7 _, err := os.FindProcess(pid) 8 9 return err == nil 10 } 11 12 // KillProcess force-stops a process. 13 func KillProcess(pid int) { 14 p, err := os.FindProcess(pid) 15 if err == nil { 16 _ = p.Kill() 17 } 18 }