[project] change syscall to /x/sys/unix|windows

Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
This commit is contained in:
Christopher Jones
2017-05-23 10:22:32 -04:00
parent 6978a6e25a
commit 069fdc8a08
93 changed files with 499 additions and 474 deletions

View File

@@ -3,12 +3,12 @@
package pidfile
import (
"syscall"
"golang.org/x/sys/unix"
)
func processExists(pid int) bool {
// OS X does not have a proc filesystem.
// Use kill -0 pid to judge if the process exists.
err := syscall.Kill(pid, 0)
err := unix.Kill(pid, 0)
return err == nil
}

View File

@@ -1,6 +1,8 @@
package pidfile
import "syscall"
import (
"golang.org/x/sys/windows"
)
const (
processQueryLimitedInformation = 0x1000
@@ -9,13 +11,13 @@ const (
)
func processExists(pid int) bool {
h, err := syscall.OpenProcess(processQueryLimitedInformation, false, uint32(pid))
h, err := windows.OpenProcess(processQueryLimitedInformation, false, uint32(pid))
if err != nil {
return false
}
var c uint32
err = syscall.GetExitCodeProcess(h, &c)
syscall.Close(h)
err = windows.GetExitCodeProcess(h, &c)
windows.Close(h)
if err != nil {
return c == stillActive
}