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.
“ | The most horrifying thing about Unix is that, no matter how many times you hit yourself over the head with it, you never quite manage to lose consciousness. It just goes on and on. | ” |
— Patrick Sobalvarro |