title: What is the difference between using _exit() & exit() in a conventional Linux fork-exec?
body: <p>I've been trying to figure out how the fork-exec mechanism is used inside Linux.  Everything was going on according to the plan until some web pages started to confuse me.</p>
  
  <p>It is said that a child process should strictly use <code>_exit()</code> instead of a simple <code>exit()</code> or a normal return from <code>main()</code>. </p>
  
  <p>As I know, Linux shell fork-execs every one of the external commands; assuming what I said above is true, the conclusion is that none of these external commands nor any other execution happening inside the Linux shell can do normal return!</p>
  
  <p>Wikipedia &amp; some other webpages claim we've got to use <code>_exit()</code> just to prevent a child process causing deletion of parent's temporary files while a probable double flushing of stdio buffers may happen. though I understand the former, I have no clues how a double flushing of buffers could be harmful to a Linux system.</p>
  
  <p>I've spent my whole day on this...
  Thanks for any clarification.</p>