X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=vendor%2Fgithub.com%2Fhashicorp%2Fgo-plugin%2Fprocess_posix.go;fp=vendor%2Fgithub.com%2Fhashicorp%2Fgo-plugin%2Fprocess_posix.go;h=70ba546bf6ddc222f414759c2da0fc3125113ddc;hb=3b42558b095c27ed9c69144d984fafe3a5b615f2;hp=0000000000000000000000000000000000000000;hpb=ddc7106558f020bde24cc337d51649611dddaba8;p=bytom%2Fvapor.git diff --git a/vendor/github.com/hashicorp/go-plugin/process_posix.go b/vendor/github.com/hashicorp/go-plugin/process_posix.go new file mode 100644 index 00000000..70ba546b --- /dev/null +++ b/vendor/github.com/hashicorp/go-plugin/process_posix.go @@ -0,0 +1,19 @@ +// +build !windows + +package plugin + +import ( + "os" + "syscall" +) + +// _pidAlive tests whether a process is alive or not by sending it Signal 0, +// since Go otherwise has no way to test this. +func _pidAlive(pid int) bool { + proc, err := os.FindProcess(pid) + if err == nil { + err = proc.Signal(syscall.Signal(0)) + } + + return err == nil +}