Getting the machine serial number and CPU ID using C/C++ in Linux

后端 未结 5 636
[愿得一人]
[愿得一人] 2020-11-30 01:01

How can I get the machine serial number and CPU ID in a Linux system?

Sample code is highly appreciated.

5条回答
  •  情话喂你
    2020-11-30 01:27

    The Informations about the processor you could extract from /proc/cpuinfo.

    To get the Serial Number you should have a look at dmidecode. I didn't look in there right now, but dmidecode is able to show you the serial number, so i would start there.

提交回复
热议问题