Re: Determining if a user's comp has 2 processors
Re: Determining if a user's comp has 2 processors
- Subject: Re: Determining if a user's comp has 2 processors
- From: email@hidden
- Date: Sat, 8 Mar 2003 10:44:54 +0100
On samedi, mars 8, 2003, at 10:09 AM, Simone Manganelli wrote:
What's the best way to quickly figure out if the user's computer has 2
processors or not? Any suggestions would be great.
Maybe not the best way but one way:
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <mach/machine.h>
#include <mach/mach_types.h>
#include <mach/processor_info.h>
kern_return_t error;
processor_info_array_t tArray;
natural_t tProcNumber;
mach_msg_type_number_t tProcessor_infoCnt;
error =
host_processor_info(mach_host_self(),PROCESSOR_BASIC_INFO,&tProcNumber,&
tArray,&tProcessor_infoCnt);
if (error == KERN_SUCCESS)
{
CPUNumber_=tProcNumber;
vm_deallocate( mach_task_self(), (vm_address_t)tArray,
tProcessor_infoCnt );
}
else
{
mach_error("host_processor_info", error);
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.