From f718d6b8c685bf478b4f4c4b4d11f6d3fd5834a2 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Thu, 30 Jun 2016 06:26:34 -0700 Subject: [PATCH] Fix s390x build failure by removing golang.org/x/sys This fix tries to fix the issue raised in #24168 where golang.org/x/sys causes s390x build failure. This fix removed the import of "golang.org/x/sys/unix". This fix fixes #24168. Signed-off-by: Yong Tang --- sysinfo/numcpu_linux.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sysinfo/numcpu_linux.go b/sysinfo/numcpu_linux.go index 5274696..5eacd35 100644 --- a/sysinfo/numcpu_linux.go +++ b/sysinfo/numcpu_linux.go @@ -6,8 +6,6 @@ import ( "runtime" "syscall" "unsafe" - - "golang.org/x/sys/unix" ) // numCPU queries the system for the count of threads available @@ -17,10 +15,10 @@ import ( // Returns 0 on errors. Use |runtime.NumCPU| in that case. func numCPU() int { // Gets the affinity mask for a process: The very one invoking this function. - pid, _, _ := syscall.RawSyscall(unix.SYS_GETPID, 0, 0, 0) + pid, _, _ := syscall.RawSyscall(syscall.SYS_GETPID, 0, 0, 0) var mask [1024 / 64]uintptr - _, _, err := syscall.RawSyscall(unix.SYS_SCHED_GETAFFINITY, pid, uintptr(len(mask)*8), uintptr(unsafe.Pointer(&mask[0]))) + _, _, err := syscall.RawSyscall(syscall.SYS_SCHED_GETAFFINITY, pid, uintptr(len(mask)*8), uintptr(unsafe.Pointer(&mask[0]))) if err != 0 { return 0 }