The signal never has a chance to be caught as you exit the child right after setting the signal handler and printing your second "I am child" line.
Turn that exit into a sleep(10) and put a sleep(5) before the kill in the parent's block. Making the parent sleep will ensure that the child process has time to set the signal handler before the parent tries to kill it.
Update: Yeah, what merlyn said. Except, do make the parent sleep briefly as well, for the reason I gave above.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Catching signals
by sauoq
in thread Catching signals
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |