title: how to reset alarm() in c linux
body: <p>Once the <code>alarm(5)</code> or what ever seconds is started and running, after some time in the program if some actions happens I need to reset the alarm again to <code>alarm(5)</code>. How can I achieve this?</p>
  
  <p>Any alarm <code>reset()</code> available?</p>
  
  <pre><code>int flag=0;
  void alarmhand(int signal)
  { 
    flag=1;
    // printf("\n time out");
  }
  
  void main()
  {
    signal(SIGALRM,alarmhand);
    alarm (5);
    while(1)
    {
     event_status();
     if(flag==1)
         break;
    } 
  }
  
  void event_status()
  {
    int reset;
    printf("reset 1=y/2=n :");
    scanf("%d",&amp;reset);
    if(reset==1)
    {
     // alarm.reset(5);
    // HOW DO I RESET THE ALARM AGAIN TO 5 HERE ??
    }
  }
  </code></pre>