Is there a difference calling daemon(0,0) from within a program, and launching a program to be in ba

Posted by Tree77 on Stack Overflow See other posts from Stack Overflow or by Tree77
Published on 2010-06-03T14:31:57Z Indexed on 2010/06/03 14:44 UTC
Read the original article Hit count: 178

Filed under:
|
|

I think the title says it all, however, I'll expand a bit.

Is there a difference between having the following code at the begining of program 'progX'

if(daemon(0, 0) == -1)
{
    printf("daemon error: %s", strerror(errno));
}

or running 'progX' via the command: progX & 2>/dev/null 1>/dev/null 0>/dev/null

© Stack Overflow or respective owner

Related posts about c

    Related posts about linux