title: When will linux close a fd except I call 'close'?
body: <p>When will linux close a fd except I call 'close'?</p>
  
  <p>The fd may be a socket, a pipe, a file, or anything else.</p>
  
  <p>I know it will be closed when:</p>
  
  <ol>
  <li><p>I call 'close' function directly or indirectly (e.g. fclose(FILE*)).</p></li>
  <li><p>The program is forked (as child) and the fd has a CLOEXEC flag.</p></li>
  <li><p>The program is crashed or exited.</p></li>
  </ol>
  
  <p>Is there any way else that makes a fd closed?
  Thanks a lot.</p>