1
0
Fork 0
forked from External/grumble
grumble/pkg/blobstore/pid_windows.go
2011-05-16 23:32:41 +02:00

20 lines
430 B
Go

// Copyright (c) 2011 The Grumble Authors
// The use of this source code is goverened by a BSD-style
// license that can be found in the LICENSE-file.
package blobstore
import (
"syscall"
)
func getPid() uint64 {
handle, _ := syscall.GetCurrentProcess()
return uint64(handle)
}
func pidRunning(pid uint64) bool {
var status uint32
syscall.GetExitCodeProcess(uint32(pid), &status)
return status == 259 // STILL_ACTIVE
}