2015-03-23 21:03:14 +00:00
|
|
|
/*
|
2015-02-26 15:02:31 +00:00
|
|
|
PURPOSE: ( Child signal handler )
|
|
|
|
PROGRAMMERS: (((Alex Lin) (NASA) (Feb 2008) (--) (Realtime)))
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @relates Trick::Executive
|
2015-03-23 21:03:14 +00:00
|
|
|
* C binded function to handle the SIGCHLD signal. The handler removes child processes
|
|
|
|
* from the process table when a child process exits.
|
2015-02-26 15:02:31 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
void child_handler(int sig) {
|
|
|
|
|
|
|
|
int status;
|
|
|
|
|
|
|
|
switch (sig) {
|
|
|
|
case SIGCHLD:
|
|
|
|
#if !( __ghs )
|
|
|
|
wait(&status);
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|