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