title: C: SIGALRM - alarm to display message every second
body: <p>So I'm trying to call an alarm to display a message "still working.." every second.
  I included signal.h.</p>
  
  <p>Outside of my main I have my function: (I never declare/define s for int s)</p>
  
  <pre><code>void display_message(int s);   //Function for alarm set up
  void display_message(int s) {
       printf("copyit: Still working...\n" );
       alarm(1);    //for every second
       signal(SIGALRM, display_message);
  }
  </code></pre>
  
  <p>Then, in my main</p>
  
  <pre><code>while(1)
  {
      signal(SIGALRM, display_message);
      alarm(1);     //Alarm signal every second.
  </code></pre>
  
  <p>That's in there as soon as the loop begins. But the program never outputs the 'still working...' message. What am I doing incorrectly? Thank you, ver much appreciated.</p>