In addition to what Ian said, you might consider doing this in some
other way. First, POSIX defines the concept of "process groups", which
are used to control processes in groups. Say, shells place all
processes participating in a pipeline, in the same process groups.
Each job started by a shell is in its own process group. The main
feature of a process group is that you're able to send a singal to the
whole PG. If interested, please check out setpgid(2) and killpg(2)
manual pages.
Another, Linux-specific, approach is cgroups (which are gaining
momentum along with light-weight virtualization, like LXC).
I have no experience with them but one of their much-touted feature is
that bringing down a specific cgroup is guaranteed to kill all the
processes associated with it, and there's no way for a process to
escape this (as is the case with process groups).
Of course, all of the above assumes you yourself want to explicitly
bring the whole hierarchy of the processes you have started. If the
question was really about taking down the child processes of a process
someone else killed, then there's no generic solution, I'm afraid.