Browse Source

Merge pull request #1031 from scop/getconf

Get number of processors using getconf over cpuinfo grep
pull/1041/head
Yamashita, Yuu 8 years ago
committed by GitHub
parent
commit
428a94b3ed
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      plugins/python-build/bin/python-build

+ 2
- 1
plugins/python-build/bin/python-build View File

@ -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…
Cancel
Save