API for current running process details like process name, process id, amount of memory used
Quote:
I'm new to linux can you please tell me the link of the documentation of API for to write a Linux C++ code to find all the current running process details like process name, process id, amount of memory used etc |
You can use the proc filesystem. Documented in the proc man page. Approximate workflow:
use getpid() to get process ID read appropriate files under /proc/<process ID> I even found a C++ example how to access /proc: http://blog.davidecoppola.com/2016/1...line-in-linux/. And another example getting some information from several processes. To learn more about the proc filesystem, you may want to search for procfs. I remember the pstat(2) system call in UNIX, but it seems to me that Linux doesn't have it. |
All times are GMT -5. The time now is 11:00 PM. |