title: Is there any method to wait until task catch SIGALRM signal in intel arch?
body: <p>I'm programming iwth gcc version 4.4.3 on Ubuntu 10.04
  I don't know how to catch SIGALRM with sigtimedwait(),sigwait().</p>
  
  <p>If timer handler is set , sigtimedwait(),sigwait() always returns EINTR(4).
  If timer handler is not set, SIGALRM never received.</p>
  
  <p>Is there any method to wait until task catch SIGALRM signal in intel arch?</p>
  
  <pre><code>void handler( int signo )
  {
  ...
  }
  
  int main( void )
  {
    timer_t timer_id;
    struct sigaction sigact;
    struct itimerspec itval;
    int ret;
    struct timespec pTimeout;
    siginfo_t pInfo;
  
    pTimeout.tv_sec = 10;
    pTimeout.tv_nsec = 0;
  
  // set signal handler for SIGALRM
    sigact.sa_handler = handler;
    sigact.sa_flags = 0;
    sigemptyset( &amp;sigact.sa_mask );
  
    sigaction( SIGALRM, &amp;sigact, NULL );
  
  // create timer
    timer_create( CLOCK_REALTIME, NULL, &amp;timer_id );
  
    itval.it_value.tv_sec = 3;
    itval.it_value.tv_nsec = 0;
  
    itval.it_interval.tv_sec = 0;
    itval.it_interval.tv_nsec = 250 * 1000 * 1000;
  
  // set timer
    timer_settime( timer_id, 0, &amp;itval, NULL );
  
    int count;
    for ( count = 0; count &lt; 10; count++ )
    {
  // wait for SIGALRM
  
      ret = sigtimedwait
              (
                      &amp;sigact.sa_mask,    /* the signal mask while suspended */
                      &amp;pInfo,                    /* return value */
                      &amp;pTimeout  
              );
   .....
     }
  </code></pre>