1.11M Members

getting terminated process id in handler

 
0
 

how do i get the child id without calling wait? is there a way to put wait information back so another waitpid can get it...?

void sigchld_handler(int signo) {
  pid_t p = wait(NULL);
  ...
}
 
0
 

AFAIK, you can only wait for each child exactly once.

The process 'stub' the OS keeps around between the end of the child to hold the information you get with 'wait' calls will disappear as soon as that information is delivered to you.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: