I would like to get some infos with C about hardware:
- how many CPU's I have
- how many cores have each of them
- how many logical cores have every core in every CPU
- CPU name + model
- CPU speed + frequency
- CPU architecture (x86, x64)
I know that on Linux-like OS I can parse /proc/cpuinfo
but since its not an ordinary file, I think its unsafe. Saw this answer on SO but it doesnt give me EVERY info I need. Should I call cat /proc/cpuinfo > file.txt
and then parse file.txt
? I know about cpuid.h
(Im using GCC) but ca't find any doc about this header (anyway - is it a good idea to use it?)