mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Get number of processors using getconf over cpuinfo grep
This commit is contained in:
parent
7ab48c47fd
commit
fc4f496545
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue