how to get the running time of a hard disk with C/C++

Viewed 144

In Linux, I want to get Hard Disk's Power On Hours with c++? Can someone tell me which API should be used? Are there any related books recommend to me? Or tell me more about Linux and c++

1 Answers

you could call smartmontools e.g. smartctl and parse the output or do some research which libs or kernel apis it uses itself

Related