determine pid of terminated process

Posted by Hristo on Stack Overflow See other posts from Stack Overflow or by Hristo
Published on 2010-04-07T20:02:31Z Indexed on 2010/04/07 20:03 UTC
Read the original article Hit count: 340

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about waitpid

Related posts about c