blob: e69127f9fa18b32779142bfeb43e68259522c2b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
$NetBSD: patch-base_cpu__stats.cc,v 1.4 2021/02/15 14:50:23 ryoon Exp $
* NetBSD support
--- base/cpu_stats.cc.orig 2021-02-15 03:48:53.000000000 +0000
+++ base/cpu_stats.cc
@@ -122,13 +122,13 @@ float CPUStats::GetSystemCPULoad() {
#endif // __APPLE__
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
// NOT IMPLEMENTED
// TODO(taku): implement Linux version
// can take the info from /proc/stats
const uint64 total_times = 0;
const uint64 cpu_times = 0;
-#endif // OS_LINUX || OS_ANDROID || OS_WASM
+#endif // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
return UpdateCPULoad(total_times, cpu_times, &prev_system_total_times_,
&prev_system_cpu_times_);
@@ -175,11 +175,11 @@ float CPUStats::GetCurrentProcessCPULoad
TimeValueTToInt64(task_times_info.system_time);
#endif // __APPLE__
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
// not implemented
const uint64 total_times = 0;
const uint64 cpu_times = 0;
-#endif // OS_LINUX || OS_ANDROID || OS_WASM
+#endif // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
return UpdateCPULoad(total_times, cpu_times,
&prev_current_process_total_times_,
@@ -206,9 +206,9 @@ size_t CPUStats::GetNumberOfProcessors()
return static_cast<size_t>(basic_info.avail_cpus);
#endif // __APPLE__
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
// Not implemented
return 1;
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
}
} // namespace mozc
|