...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package numcpus
16
17 import "golang.org/x/sys/windows"
18
19 func getConfigured() (int, error) {
20 return int(windows.GetActiveProcessorCount(windows.ALL_PROCESSOR_GROUPS)), nil
21 }
22
23 func getKernelMax() (int, error) {
24 return int(windows.GetMaximumProcessorCount(windows.ALL_PROCESSOR_GROUPS)), nil
25 }
26
27 func getOffline() (int, error) {
28 return 0, ErrNotSupported
29 }
30
31 func getOnline() (int, error) {
32 return int(windows.GetActiveProcessorCount(windows.ALL_PROCESSOR_GROUPS)), nil
33 }
34
35 func getPossible() (int, error) {
36 return int(windows.GetActiveProcessorCount(windows.ALL_PROCESSOR_GROUPS)), nil
37 }
38
39 func getPresent() (int, error) {
40 return int(windows.GetActiveProcessorCount(windows.ALL_PROCESSOR_GROUPS)), nil
41 }
42
View as plain text