mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Merge pull request #1031 from scop/getconf
Get number of processors using getconf over cpuinfo grep
This commit is contained in:
commit
428a94b3ed
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