I'm writing a code forking (number of 3, 5, ... indefinite number). I wish my program to end after the time specified(parent kills firstly its children then itself probably by calling _exit which is also sig-safe). I mean in signal handler I kill whole children by kill() then call waitpid() for all since both are kind of async-signal-safe function. To do that, I'm using setitimer(ITIMER_REAL, &timer, NULL
before forking.
So is it inherited by the forked children?
If it is not inherited, could you show a source?
If it is inherited, do all children end as well after the time is taken? In addition, actually I don't want the case.