cosmopolitan/tool/zsh/nproc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
283 B
Text
Raw Normal View History

[[ -x $(whence -p nproc) ]] && {
command nproc && {
unfunction nproc
return
}
}
[[ -x $(which sysctl) ]] && {
nproc() {
sysctl -n hw.ncpu
}
nproc && return
}
# TODO other platforms
echo nproc: no implementation found >&2
nproc() {
echo 2
}
nproc
# vim:ft=zsh