title: What's the opposite of close(fd) in C?
body: <p>I am trying to make a mini shell where commands are piped to each other. At some points in the code I do:</p>
  
  <pre><code>close(1) //closing stdout
  </code></pre>
  
  <p>and </p>
  
  <pre><code>close(0) //closing stdin
  </code></pre>
  
  <p>However later on I am forking so I want my new subprocess to reset everything. So how would I:</p>
  
  <pre><code>*function_name_here*(1) //reopening stdout
  </code></pre>
  
  <p>and</p>
  
  <pre><code>*function_name_here*(0) //reopening stdin
  </code></pre>