title: read one byte at a time using poll/select
body: <p>I am trying to read off a file descriptior of a device.with the following code using poll/select.I am able to read the bytes of the device.I want to know when would be the right time to exit the loop.I am reading one character at a time.once it has read all the bytes I need to exit from the loop.how do I accomplish that.</p>
  
  <pre><code>while (continue_reading) 
  {   n = read(radioFd, &amp;rc, 1);
          if(rc == START_OF_FRAME)
          {
               start_buffering = 1;
               printf("SOF found \n");
          }
          if(1 == start_buffering)
          {
               read_buffer[read_count] = rc;
               read_count += n;
          } 
  }
  </code></pre>