diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-02 19:26:40 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-02 19:28:44 +0200 |
commit | 712654d4c023a2ab13190c6905d313e0ba897965 (patch) | |
tree | b8505b420d6621022fa6a46271340071d8881322 /cpucount.c | |
parent | Made displayln into a library export. (diff) | |
download | calp-712654d4c023a2ab13190c6905d313e0ba897965.tar.gz calp-712654d4c023a2ab13190c6905d313e0ba897965.tar.xz |
Rewrite test running system.
Diffstat (limited to 'cpucount.c')
-rw-r--r-- | cpucount.c | 12 |
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)); +} |