How do I find the process details from the C code
I need to write a Linux C++ code to find all the current running process details like process name, process id, amount of memory used etc. Something like ps -ef or top output. Is there any API to get these details. Please help.
Thanks in advance. |
Quote:
|
Quote:
U can refer to the book "Advanced Programming in unix environment" from Richard Stevens |
From strace on ps and top, I found that these commads are finding the all process related details from /proc directory, which contain one director for each of the running process with process id as the directoy name. Inside each of this directory we can get all the details like process name, memory used, status etc...
|
All times are GMT -5. The time now is 09:30 AM. |