Hi, I wrote a program where the parent creates many children with fork(). I then made all of them to pause(), cause I needed to send them the signal 15 to kill them. Once I sent them that signal, in the parent I use waitpid() to collect the zombie children (lol) and kill them instead of showing them as <defunct>.
My problem now is that I need to send the children the signals 16 and 17 (SIGUSR1 and SIGUSR2) indefinitely. In particular, I need to make a handler for SIGUSR1 that allows me to increase a counter in every children, as many times as I want. For example:
- Send to the child 4 the signal SIGUSR1: <counter of child 4: 1>
- Send to the child 4 the signal SIGUSR1: <counter of child 4: 2>
- Send to the child 4 the signal SIGUSR1: <counter of child 4: 3>
- Send to the child 2 the signal SIGUSR1: <counter of child 2: 1>
And so on... but as I send the first signal, the child terminates execution, and I don't know how to maintain every child running with the parent, while the parent is asking forever to the user which signal to send. Is there any function that I don't know of to do that?

Thanks.