trick/trick_source/sim_services/Executive/child_handler.cpp

31 lines
565 B
C++
Raw Normal View History

/*
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
* 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;
}