aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-24 13:23:34 -0400
committerIan Moffett <ian@osmora.org>2024-05-24 13:23:34 -0400
commit3f9b766a3e19eb9dde9779adc1ea91474c3efbb5 (patch)
tree62eee860a81d91a5cd056370d1cfc1d872c1ce0a /sys/kern
parent9a6d04290806afec59c988419cdac0fdbe4509ff (diff)
kernel: cpu: Add cpu_count() for reading 'ncpu'
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_cpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c
index 97a7aa4..1779244 100644
--- a/sys/kern/kern_cpu.c
+++ b/sys/kern/kern_cpu.c
@@ -68,3 +68,9 @@ cpu_get(size_t i)
return ci_list[i];
}
+
+size_t
+cpu_count(void)
+{
+ return ncpu;
+}