diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2001-06-23 17:03:27 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2001-06-23 17:03:27 +0000 |
commit | 17bb3c6612a856845e46b803c6f424ef3609e806 (patch) | |
tree | 6a7c5e5ed0f4f2d5b82b7a8df45e25ea3cba0721 /usr.bin | |
parent | 6b8ef2e0b4f979b9d5fe4e51edf780897a8c0dd7 (diff) | |
download | FreeBSD-src-17bb3c6612a856845e46b803c6f424ef3609e806.zip FreeBSD-src-17bb3c6612a856845e46b803c6f424ef3609e806.tar.gz |
Make sure to try hw.ncpu if kern.smp.cpus doesn't exist (i.e. on UP) when
getting number of CPUs.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/mbufs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c index f793053..df53e0c 100644 --- a/usr.bin/systat/mbufs.c +++ b/usr.bin/systat/mbufs.c @@ -190,7 +190,8 @@ initmbufs() nmbtypes = mbtypeslen / sizeof(*m_mbtypes); #endif len = sizeof(int); - if (sysctlbyname("kern.smp.cpus", &ncpu, &len, NULL, 0) < 0) { + if (sysctlbyname("kern.smp.cpus", &ncpu, &len, NULL, 0) < 0 && + sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0) < 0) { error("sysctl getting number of cpus"); return 0; } |