From: Thomas K. <tho...@us...> - 2005-02-21 23:20:59
|
On Mon, Feb 21, 2005 at 06:13:34PM +0100, Dennis Smit wrote: > On Mon, 2005-02-21 at 14:57 +0100, Thomas Klausner wrote: > > Thanks again. Yes, here it is: > > > > #include <sys/param.h> > > #include <sys/sysctl.h> > > > > int mib[2], ncpu; > > size_t len; > > > > mib[0] = CTL_HW; > > mib[1] = HW_NCPU; > > > > len = sizeof(ncpu); > > sysctl(mib, 2, &ncpu, &len, NULL, 0); > > > > Then ncpu contains the number of CPUs. > > Alright, thank you! Will this also work on free and openbsd, or > can you enlighten me a bit on those two as well ? For FreeBSD I guess it should work, see http://www.freebsd.org/cgi/man.cgi?query=sysctl%283%29&apropos=0&sektion=0&manpath=FreeBSD+5.3-RELEASE+and+Ports&format=html OpenBSD also seems to have it: http://www.openbsd.org/cgi-bin/man.cgi?query=sysctl&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html > > Are the other CRITICAL warnings from the log I posted something > > that should be investigated? > > Those others are known, gonna be fixed for 0.4.0 :) Cool :) Thomas |