title: read() on a NON-BLOCKING tun/tap file descriptor gets EAGAIN error
body: <p>I want to read IP packets from a non-blocking tun/tap file descriptor <code>tunfd</code>
  I set the <code>tunfd</code> as non-blocking and register a READ_EV event for it in libevent.</p>
  
  <p>when the event is triggered, I read the first 20 bytes first to get the IP header, and then
  read the rest.</p>
  
  <pre><code>nr_bytes = read(tunfd, buf, 20);
  ...
  ip_len = .... // here I get the IP length
  ....
  nr_bytes = read(tunfd, buf+20, ip_len-20);
  </code></pre>
  
  <p>but for the <code>read(tunfd, buf+20, ip_len-20)</code>
  I got EAGAIN error, actually there should be a full packet,
  so there should be some bytes,
  why I get such an error?</p>
  
  <p>tunfd is not compatible with non-blocking mode or libevent?</p>
  
  <p>thanks!</p>