Why fork() before setsid()

Posted by corentin.kerisit on Stack Overflow See other posts from Stack Overflow or by corentin.kerisit
Published on 2010-04-10T10:52:58Z Indexed on 2010/04/10 12:03 UTC
Read the original article Hit count: 123

Filed under:
|
|
|
|

Why fork() before setsid() to daemonize a process ?

Basically, if I want to detach a process from its controlling terminal and make it a process group leader : I use setsid().

Doing this without forking before doesn't work.

Why ?

Thanks :)

© Stack Overflow or respective owner

Related posts about c

    Related posts about unix