title: using select() with pipe
body: <p>I am <em>reading/writing</em> to a pipe created by <code>pipe(pipe_fds)</code>. So basically with following code, I am reading from that pipe: </p>
  
  <pre><code>fp = fdopen(pipe_fds[0], "r"); 
  </code></pre>
  
  <p>And when ever I get something, I print it out by: </p>
  
  <pre><code>while (fgets(buf, 200, fp)) {
      printf("%s", buf);
  }
  </code></pre>
  
  <p>What I want is, when for certain amount of time nothing appears on the <code>pipe</code> to <code>read</code> from, I want to know about it and do:</p>
  
  <pre><code>printf("dummy");
  </code></pre>
  
  <p>Can this be achieved by <a href="http://pubs.opengroup.org/onlinepubs/7908799/xsh/select.html" rel="noreferrer">select()</a> ? Any pointers on how to do that will be great.</p>