浏览代码

Merge pull request #1031 from scop/getconf

Get number of processors using getconf over cpuinfo grep
pull/1041/head
Yamashita, Yuu 8 年前
提交者 GitHub
父节点
当前提交
428a94b3ed
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      plugins/python-build/bin/python-build

+ 2
- 1
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

正在加载...
取消
保存