The daemon
function shall create a new process,
detached from the controlling terminal. If successful, the calling process
shall exit and the new process shall continue to execute the application
in the background.
If nochdir evaluates to true, the current directory
shall not be changed. Otherwise,
daemon
shall change the current working directory
to the root (`/'). If noclose evaluates to true
the standard input, standard output, and standard error file
descriptors shall not be altered. Otherwise,
daemon
shall close
the standard input, standard output and standard error file descriptors
and reopen them attached to
/dev/null.