The problem is that the only parameter that the handler receives is the signal that activated it. How could I know the pid of the child I need to kill (without a global) kill(0, SIGKILL); will kill the parent too (I don't think I want that)
Another thing: how can I set up an environment to the child, so it cannot perform some system calls (like fork) ?