Get hardware information from /proc filesytem in Linux
I use execv to run lshw command to get the CPU, disk, and memory in C code. But I would like to search another solution to get these information from /proc or any other existed data. Have any suggestion? Here is my code: char *params[9] = {"/usr/bin/lshw", "-short", "-c", "disk", "-c", "memory", "-c", "processor", 0}; //cmd params filled execv(params[0], params); Linux command: $ sudo lshw -short -c disk -c processor -c memory $ sudo lshw -short -c disk -c processor -c memory H/W path Device Class Description ====================================================== /0/0 memory 64KiB BIOS /0/22