aboutsummaryrefslogtreecommitdiff
path: root/cpucount.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpucount.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpucount.c b/cpucount.c
new file mode 100644
index 00000000..2049cad0
--- /dev/null
+++ b/cpucount.c
@@ -0,0 +1,12 @@
+/**
+ Basic script for checking number of available CPU cores.
+
+ Used by tests to spawn an appropriate number of threads.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+
+int main() {
+ printf("%i\n", sysconf(_SC_NPROCESSORS_ONLN));
+}