title: Pausing a child process in C
body: <p>In my C program I'm trying to pause the state of a child process created by execl when the user input is 'p'. I have two terminals one for input which is the parent and another for output which is the child process. I have signal handlers in the child process that the parent can send to in order to increase and decrease the speed at which its output. I tried doing</p>
  
  <pre><code>kill(child_pid,SIGSTOP)
  </code></pre>
  
  <p>but this just stops both the child and the parent.</p>
  
  <p>As of now in order to pause I have signal_handlers saving the current speed then changing the speed to 2147483647 seconds then when they resume it puts the saved speed back. Is this reasonable?(That is approx. 68 years and I have it in a while loop)</p>
  
  <p>Sent output to other terminal with code below.</p>
  
  <pre><code>static state* start_button(void)
  {
      state *destination;                                                        
  
      pid_t pid;                                                    
      pid = fork();                                                 
      switch(pid)                                                   
      {                                                                          
          case -1:                                   
              destination = &amp;ready;                                              
              break;                                                             
          case 0:                                                                          
              execl("./outputTerminal",
                  "outputTerminal",file_number,"/dev/ttys001",NULL);                                                                     
              break;                                                             
          default:                                                               
              destination = &amp;going;                                            
              break;                                                             
      }                                                                          
  
      return destination;
   }
  </code></pre>