for my C project I need to know in which state (running, waiting, terminated, ...) the various processes are. The processes are created by myself using many fork(). Does anyone have any idea how to do that?
Example: I have a process with PPID = x I do 3 fork() -> I get three new processes with PID = x+1, PID = x+2, and PID = x+3 (more or less). I need to know if the processes with PID = x+1, PID = x+2, and PID = x+3 are running or waiting or terminated.
if you do 3
fork()'s you have more than 3 new processes. You have 2^n processes. n being the number of times you callfork()for example
prints this
also I do believe your question has been answered here