title: Why fork() before setsid()
body: <p>Why <code>fork()</code> before <code>setsid()</code> to daemonize a process?</p>
  
  <p>Basically, if I want to detach a process from its controlling terminal and make it a process group leader : I use <code>setsid()</code>.</p>
  
  <p>Doing this without forking before doesn't work.</p>
  
  <p>Why?</p>