I am working on osx and i would like to get some info about my cpu. To do that, i found the terminal commande sysctl -a, but i need to get these informations in a programme
I can do this on my iMac
#include #include #include #define BUFFERLEN 128 int main(){ char buffer[BUFFERLEN]; size_t bufferlen = BUFFERLEN; sysctlbyname("machdep.cpu.brand_string",&buffer,&bufferlen,NULL,0); printf("%s\n", buffer); }
and I get this
Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz