0

I'm trying to implement a system which sends via Bluetooth sockets, information about the current system (in fact, a Linux server). This back-end code is in C. I'd like to know if there's an available library to get info like cpu temperature, disk usage and process running, just to name a few inside C code. If it's not possible, what kind of alternatives do you suggest to me ?

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
aajjbb
  • 91
  • 1
  • 9

1 Answers1

1

To find disk usages - see lstat(), pick st_size to get the size of file and get the disk usages. No of running processes could be found by reading /proc, all the running processes has pidno under /proc. And, currently, I'm unaware of how to get cpu temperature. But, you can get cpufreq related info from /sys/devices/system/cpu/cpufreq.

rakib_
  • 136,911
  • 4
  • 20
  • 26