Browse code

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 <yong.tang.github@outlook.com>

Yong Tang authored on 2016/06/30 22:26:34
Showing 1 changed files
... ...
@@ -6,8 +6,6 @@ import (
6 6
 	"runtime"
7 7
 	"syscall"
8 8
 	"unsafe"
9
-
10
-	"golang.org/x/sys/unix"
11 9
 )
12 10
 
13 11
 // numCPU queries the system for the count of threads available
... ...
@@ -17,10 +15,10 @@ import (
17 17
 // Returns 0 on errors. Use |runtime.NumCPU| in that case.
18 18
 func numCPU() int {
19 19
 	// Gets the affinity mask for a process: The very one invoking this function.
20
-	pid, _, _ := syscall.RawSyscall(unix.SYS_GETPID, 0, 0, 0)
20
+	pid, _, _ := syscall.RawSyscall(syscall.SYS_GETPID, 0, 0, 0)
21 21
 
22 22
 	var mask [1024 / 64]uintptr
23
-	_, _, err := syscall.RawSyscall(unix.SYS_SCHED_GETAFFINITY, pid, uintptr(len(mask)*8), uintptr(unsafe.Pointer(&mask[0])))
23
+	_, _, err := syscall.RawSyscall(syscall.SYS_SCHED_GETAFFINITY, pid, uintptr(len(mask)*8), uintptr(unsafe.Pointer(&mask[0])))
24 24
 	if err != 0 {
25 25
 		return 0
26 26
 	}