tags:

views:

19

answers:

1

my parent process is unable to catch the SIGCHLD even though its on waitpid(SIGCHLD... for it. 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 ?

+1  A: 

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.

nategoose
Signal handler may an empty function: the SIGCHLD simply may not be ignored or blocked. And that is not unique to AIX, that is default behavior on pretty much all *nix systems including Linux.
Dummy00001