How to get hogs / pidin / sin information in c / c++ ?

How to get hogs / pidin / sin information in c / c++ ?

Are there in the C library any functions that gives
system statistics / information ?
e.g:

  • list the processes (and percentage consume) that are hogging CPU
  • total / free memory, etc…

Just grab hogs, pidin or sin source code and see for yourself ;-)