title: how to use fgets/fread to read a PIPE
body: <p>I have two processes A, B and a pipe(my_pipe[2]) between them, I need process A to read the output of process B. In process B, I have <code>dup2(my_pipe[1], stdout)</code>; in A, I need to keep reading the output of B and process it line by line.</p>
  
  <p>I want to use <code>fread/fgets</code> in A instead of <code>read</code>, but <code>my_pipe[0]</code> is a file descriptor instead of a *FILE.  How can I use fread/fgets for a pipe?  </p>