Re: hw.cpufamily vs ASP vs machine.h
Re: hw.cpufamily vs ASP vs machine.h
- Subject: Re: hw.cpufamily vs ASP vs machine.h
- From: Garth Cummings <email@hidden>
- Date: Wed, 28 Feb 2007 14:14:51 -0800
Hi Stephane,On Feb 28, 2007, at 1:57 PM, Stephane Sudre wrote:
On mercredi, février 28, 2007, at 08:37 PM, Peter Bierman wrote:
system_profiler is the only API that provides the human readable textual description you're looking for. The -xml flag will insulate you against format changes, and is designed for machine parsing.
Well, I took a different road. I don't want to rely on system_profiler for additional reasons (one of them is the fact that the -xml SPHardwareDataType does not work on Mac OS X 10.2, another one could be not to use a tank (slow and too much information) to kill an ant).
For PowerPC, I still use the old code if the OS is too old. For i386, I use sysctl with the machdep.cpu branch and another one to get the family and to know whether it's a multi-core or mono-core CPUs.
Just to build on Peter's comments for the benefit of the other developers on the list. This is a fairly common question sent to DTS. Be aware that there are values returned by system_profiler which aren't directly obtainable using other public means. Sometimes the raw data is converted from an internal representation into a form more appropriate for customers and support staff using a private algorithm.
--gc ____________________________________________________________________ Sr. Software Engineer Apple Developer Technical Support
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden