determine pid of terminated process
- by Hristo
I'm trying to figure out what the pid is of a process that sent the SIGCHLD signal, and I want to do this in a signal handler I created for SIGCHLD. How would I do this? I'm trying:
int pid = waitpid(-1, NULL, WNOHANG);
.. because I want to wait for any child process that is spawned.
Thanks,
Hristo