I have 2 processes written in C, I'll call them 'parent' and 'child'. Parent creates child and child enters a loop where it does some code, then raises SIGSTOP. If a certain condition is reached, the parent needs to send the child SIGTERM, otherwise SIGCONT.

How can I send it SIGTERM while it is suspended and get exactly my desired results? By simply sending it SIGCONT then SIGTERM I'm afraid the child will reach SIGSTOP before SIGTERM is sent, and I also think the 2 signals one after the other will interfere with each other.

1 Answer 1


If you have a process in a suspended state, it won't action any signals (other than SIGKILL) until it continues. A pending signal will be queued on the process.

So depending on your situation you will need to send either:

  1. SIGTERM and then SIGCONT

Of course this can be simplified to

if (condition) { send SIGTERM }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .