Revert "less indirections, directly call FreeBSD primitives"

This reverts commit a00de370c58fe2c18a49944821e113617caff1c4.
This commit is contained in:
Ludovic Rousseau 2012-07-31 10:57:27 +02:00
parent 833ab6b6cf
commit 1a51210e22

View File

@ -79,7 +79,7 @@ OS="Linux"
case $(uname) in case $(uname) in
"Linux" ) OS="Linux" ;; "Linux" ) OS="Linux" ;;
"FreeBSD") OS="FreeBSD" ;; "FreeBSD") OS="FreeBSD" ;;
"Darwin") OS="FreeBSD" ;; "Darwin") OS="Darwin" ;;
"DragonFly") OS="FreeBSD" ;; "DragonFly") OS="FreeBSD" ;;
"SunOS") OS="SunOS" ;; "SunOS") OS="SunOS" ;;
esac esac
@ -166,6 +166,11 @@ __cpunum_FreeBSD()
sysctl -n hw.ncpu sysctl -n hw.ncpu
} }
__cpunum_Darwin()
{
__cpunum_FreeBSD
}
__cpunum_SunOS() __cpunum_SunOS()
{ {
kstat -m cpu_info | grep "module: cpu_info" | wc -l kstat -m cpu_info | grep "module: cpu_info" | wc -l
@ -188,6 +193,11 @@ __load_FreeBSD()
echo -n "$load" echo -n "$load"
} }
__load_Darwin()
{
__load_FreeBSD
}
__load_SunOS() __load_SunOS()
{ {
load=$(LANG=C uptime | awk '{print $10}'| sed -e 's/,//') load=$(LANG=C uptime | awk '{print $10}'| sed -e 's/,//')