From fc4f496545f03aea42c78ed0dc23667308dae8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 8 Nov 2017 19:07:20 +0200 Subject: [PATCH] Get number of processors using getconf over cpuinfo grep --- plugins/python-build/bin/python-build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index aa610f61..46db3cf5 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -155,7 +155,8 @@ num_cpu_cores() { num="$(sysctl -n hw.ncpu 2>/dev/null || true)" ;; * ) - num="$(grep ^processor /proc/cpuinfo 2>/dev/null | wc -l | xargs)" + num="$({ getconf _NPROCESSORS_ONLN || + grep -c ^processor /proc/cpuinfo; } 2>/dev/null)" num="${num#0}" ;; esac