node ninja
node ninja

Reputation: 32986

How to get information about spawned children from their PID

In my program I am spawning child processes by using fork and execv. I am saving the child PIDs in an array. How can I get information about the children by using these PIDs? I want to get information like how much memory and CPU they are using.

Upvotes: 1

Views: 134

Answers (1)

Kristofer
Kristofer

Reputation: 3269

You could try to use the library libgtop or instead directly parse the contents of

/proc/PID/stat

Upvotes: 1

Related Questions