Permalink
Browse files

NetBSD: Add support for retrieving the number of available CPUs

$ uname
NetBSD
$ getconf NPROCESSORS_ONLN
2
$ getconf _NPROCESSORS_ONLN
getconf: _NPROCESSORS_ONLN: unknown variable
  • Loading branch information...
1 parent 9a43c44 commit 5998f75a480eca0651051374a4e6c712bae830f8 @krytarowski krytarowski committed Jan 21, 2016
Showing with 5 additions and 1 deletion.
  1. +2 −0 build.sh
  2. +3 −1 run-cppcheck.sh
View
@@ -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
View
@@ -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
@@ -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.