6
votes
2answers
3k views

Get CPU utilization stats from C program

I want to read the CPU utilization stats from a C program, I am interested in the percentage of use of CPU, steal time etc. These stats are shown in the 3rd row from the top command. I tried to parse ...
3
votes
1answer
3k views

Error when using stat, errno=2

The case is as this, I create many files, and after the file generation, I use stat to get the all files info under the directory. The purpose is to purge all the files which are old than the ...