[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: getting number of processors on user machine
From:       Adriaan de Groot <groot () kde ! org>
Date:       2006-08-28 8:43:43
Message-ID: 200608281043.43664.groot () kde ! org
[Download RAW message or body]

On Monday 28 August 2006 09:32, Kevin Ottens wrote:
> Le lundi 28 août 2006 07:51, Aaron J. Seigo a écrit :
> > int numCpus = DeviceManager::self()->findDevicesFromQuery(QString(),
> > Solid::Capability::Processor).count();
> >
>
> And it already works using the current HAL backend. ;-)

int ncpu;
size_t length = sizeof(ncpu);
if (sysctlbyname( "hw.ncpu", &ncpu, &length, NULL, 0 ) ) {
	// Number of CPUs is in ncpu
}

That's for certain non-Linux OSsen where HAL is not yet supported very well.

-- 
Adriaan de Groot
  KDE Quality Team
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic