I know not being a library has different considerations, but some ideas I used in timeout(1) to kill a process group may be useful. Tricky things like using sigsuspend() to avoid signal handling races.
https://github.com/coreutils/coreutils/blob/master/src/timeo...
cgroups might be another avenue to explore, being more modern and so having less compatibility baggage
I know not being a library has different considerations, but some ideas I used in timeout(1) to kill a process group may be useful. Tricky things like using sigsuspend() to avoid signal handling races.
https://github.com/coreutils/coreutils/blob/master/src/timeo...
cgroups might be another avenue to explore, being more modern and so having less compatibility baggage