Skip navigation.
 
ml[c++]Retrieving system information
FROM : Coockie_jr
DATE : Fri May 16 15:32:33 2008

I'm working with c++ language and I'm trying to collect as much a information
as possible on a MAC OS system like ,
nb of cpu,
frequency
usage of cpu
memory
usage of mem
list of process and their cpu usage
...


I searched a bit and it seems that sysctl may be the best to collect most of
the needed information but I get odd results for some request like
hw.cpufrequency although i get the correct output while using the terminal
command.

exemple of request

            int frequency;
            len = sizeof(frequency);
            if (sysctlbyname("hw.cpufrequency", &frequency, &len, NULL, 0)
== -1){
                std::cout << "error";
            }
            else{
                std::cout << "frequency of processor " << frequency <<
std::endl;
            }

This gives me an error while searching for hw.busfrequency works well.

Am i looking at the right tools for this kind of job ?
--
View this message in context: http://www.nabble.com/-c%2B%2B-Retrieving-system-information-tp17262844p17262844.html
Sent from the OmniGroup - MacOSX-Dev mailing list archive at Nabble.com.

Related mailsAuthorDate
ml[c++]Retrieving system information Coockie_jr May 16, 15:32
mlRe: [c++]Retrieving system information Markus Hitter May 16, 16:01
mlRe: [c++]Retrieving system information Coockie_jr May 16, 16:59