my parent process is unable to catch the SIGCHLD even though its on waitpid(SIGCHLD... for it开发者_如何学Go. Tried giving an explicit kill(SIGCHLD..) to the parent from the child to test the parent is not receiving the signal .also the flavor is AIX...do we need to compile it with some flags or some env setup ?
You need to register a signal handler to catch SIGCHLD. waitpid
is related but different from SIGCHLD. Use either signal(3)
or sigaction(2)
to register your signal handler.
To use waitpid do:
pid_t x = fork();
...
pid_t y = waitpid(x, &status, options);
SIGCHLD really just tells you that you need to call one of the wait functions.
精彩评论