title: When should I use O_CLOEXEC when I open file in Linux?
body: <p>My process forks several times, and each time the child will exec - means I want it to run some other program.</p>
  
  <p>In the main process I open a file descriptor with the <code>open()</code> syscall.</p>
  
  <p>Would it be correct to give it a flag <code>O_CLOEXEC</code> so the new program that I run with <code>exec()</code> wouldn't has the fd resource?</p>