title: epoll with timerfd
body: <p>I want to use the <code>it_interval</code> of <code>newValue</code> to set the interval of the timeout.<br>
  But in my example, I can only print <code>timeout</code>  <strong>once</strong>.<br>
  What happened? How can I set the interval?      </p>
  
  <p>This is my code:</p>
  
  <pre><code>int main()
  {
  int efd =epoll_create(256);             
  setnonblock(efd);
  struct epoll_event ev,events[256];
  
  int tfd;//timer fd
  
  if((tfd= timerfd_create(CLOCK_MONOTONIC,TFD_NONBLOCK)) &lt; 0)
    cout&lt;&lt;"timerfd create error"&lt;&lt;endl;
  
  struct itimerspec newValue;
  struct itimerspec oldValue;
  bzero(&amp;newValue,sizeof(newValue));  
  bzero(&amp;oldValue,sizeof(oldValue));
  struct timespec ts;
  ts.tv_sec = 5;
  ts.tv_nsec = 0;
  
      //both interval and value have been set
      newValue.it_value = ts; 
      newValue.it_interval = ts;
      if( timerfd_settime(tfd,0,&amp;newValue,&amp;oldValue) &lt;0)
      {
          cout&lt;&lt;"settime error"&lt;&lt;strerror(errno)&lt;&lt;endl;
      }   
  
      ev.data.fd = tfd;
      ev.events = EPOLLIN | EPOLLET;
  
      if( epoll_ctl(efd,EPOLL_CTL_ADD,tfd,&amp;ev) &lt; 0)
          cout&lt;&lt;"epoll_ctl error"&lt;&lt;endl;
  
      int num = 0;
      while(1)
      {
         if((num=epoll_wait(efd,events,256,1000)) &gt; 0)
         {//justice
              for(int i=0;i&lt;num;i++)
              {
                  if(events[i].data.fd == tfd)
                  {
                      cout&lt;&lt;"timeout"&lt;&lt;endl;
                  }
          }       
      }
      }   
  return 0;
  }
  </code></pre>