aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index fb22f59..2143c52 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -758,3 +758,10 @@ struct StrList *listdir(const char *path) {
return node;
}
+long get_cpu_count() {
+#if defined(STASIS_OS_LINUX) || defined(STASIS_OS_DARWIN)
+ return sysconf(_SC_NPROCESSORS_ONLN);
+#else
+ return 0;
+#endif
+} \ No newline at end of file