Main index | Section 3 | Options |
#include <stdlib.h>
Unless the argument nochdir is non-zero, daemon() changes the current working directory to the root ( /).
Unless the argument noclose is non-zero, daemon() will redirect standard input, standard output, and standard error to /dev/null.
The daemonfd() function is equivalent to the daemon() function except that arguments are the descriptors for the current working directory and to the descriptor to /dev/null.
If chdirfd is equal to (-1) the current working directory is not changed.
If nullfd is equals to (-1) the redirection of standard input, standard output, and standard error is not closed.
The daemon() function temporarily ignores SIGHUP while calling setsid(2) to prevent a parent session group leader's calls to fork(2) and then _exit(2) from prematurely terminating the child process.
DAEMON (3) | December 23, 2017 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Unix...best if used before: Tue Jan 19 03:14:08 GMT 2038 | ” |