Skip to content

Commit

Permalink
NetBSD: Add support for retrieving the number of available CPUs
Browse files Browse the repository at this point in the history
$ uname
NetBSD
$ getconf NPROCESSORS_ONLN
2
$ getconf _NPROCESSORS_ONLN
getconf: _NPROCESSORS_ONLN: unknown variable
  • Loading branch information
krytarowski committed Jan 21, 2016
1 parent 9a43c44 commit 5998f75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ build_coreclr()
# processors available to a single process.
if [ `uname` = "FreeBSD" ]; then
NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
elif [ `uname` = "NetBSD" ]; then
NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
else
NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
fi
Expand Down
4 changes: 3 additions & 1 deletion run-cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ SloccountOutput="sloccount.sc"
# processors available to a single process.
if [ `uname` = "FreeBSD" ]; then
NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
elif [ `uname` = "NetBSD" ]; then
NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
else
NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
fi
Expand Down Expand Up @@ -114,4 +116,4 @@ then
fi

echo Check finished. Results can be found in: $CppCheckOutputs $SlocCountOutputs
exit 0
exit 0

0 comments on commit 5998f75

Please sign in to comment.