title: Incorrect behaviour of poll system call in linux
body: <p>While using poll system call i found a stange behaviour.
  I have the following code snippet.</p>
  
  <pre><code>struct pollfd myPollfds[nCount];
  ACE_Time_Value selectTime;
  selectTime.set(60);
  
   myPollfds[0].fd = rtrrmEvent[0];
   myPollfds[0].events = POLLIN | POLLRDHUP | POLLHUP | POLLERR;
          myPollfds[0].revents = 0;
  
          myPollfds[1].fd = rtrfeEvent[0];
          myPollfds[1].events = POLLIN | POLLRDHUP | POLLHUP | POLLERR;
          myPollfds[1].revents = 0;
  
          myPollfds[2].fd = _h[msclient_pos];
          myPollfds[2].events = POLLIN | POLLRDHUP | POLLHUP | POLLERR;
          myPollfds[2].revents = 0;
  
          myPollfds[3].fd = holdTimeEvent[0];
          myPollfds[3].events = POLLIN | POLLRDHUP | POLLHUP | POLLERR;
          myPollfds[3].revents = 0;
  
          ACE_Time_Value sleepTime(0,20000);
          while(isRunning() &amp;&amp; !_stopRequested)
          {
                  ACE_OS::sleep(sleepTime);
                  for(int i = 0; i &lt; 4; i++)
                          myPollfds[i].revents = 0;
                  waitResult = ACE_OS::poll (myPollfds, nCount, &amp;selectTime);
                  if(waitResult == -1) // poll failed
                  {
                         DEBUG("%s", "poll failed");
                           continue;
                  }
                  else if(waitResult == 0) // Time out
                  {
                          //Do something .
                  }
                  char nodata[256];
  
                  for(short i = 0; i &lt; nCount; i++)
    if(myPollfds[i].revents == POLLIN)
                          {
                                  if(i == rtrrm_pos)
                                  {
                                           // Stop channel
                                  }
                                  else if(i == rtrfe_pos) // 'rtrfe' command
                                  {
                                          DEBUG("%s", "fe issued");
  
                                  }
                                  else if(i == msclient_pos || waitResult == 0)
                                  {
                                        //Do something
                                  }
                                  else if(i == holdTime_pos)
                                  {
                                          DEBUG("%s", "Hold issued");
                                  }
                          }
                          else
                          {
                                  DEBUG("polling failed with with myPollfds[i].revents == %d",myPollfds[i].revents);
                          }
  </code></pre>
  
  <p>The problem is that i get some times :
  "polling failed with with myPollfds[i].revents == 0"
   :
  "polling failed with with myPollfds[i].revents == 8193"</p>
  
  <p>the poll call is not waiting for the fd's to set.
  can any one help?</p>