Accurate Child Process Monitoring in C
Hi,
I need to make an accurate monitoring of the child processes.
I have a signal handler which I can get the child data via siginfo_t structure hence its pid and I can understand
if it is exited, killed, stopped an so on.
If the child (for example PID 2) is killed by another process (for example PID 100), in my signal handler I only can get the pid 2
not 100 instead which it's caused its dead.
If I understand right, we can inspect the child behaviour via ptrace system call.
Ptrace could help me in this case, that is, trace the process which has caused its dead?
Regards
|