Listing 4. Ignoring the SIGCHLD Signal


/*
 * Listing 4:
 * Ignoring the SIGCHLD signal
 * Ivan Griffin (ivan.griffin@ul.ie)
 */
#include <signal.h>
struct sigaction ignoreChildDeath =
{
    NULL, 0, SA_NOCLDSTOP | SA_RESTART, NULL
};
int main(int argc, char *argv[])
{
    /*
     * somewhere in main code
     */
    sigaction(SIGCHLD, &ignoreChildDeath, NULL);
    /*
     * other code
     */
    return 0;
}