 
| Main index | Section 3 | 日本語 | Options | 
#include <stdlib.h>
If the argument nochdir is zero, daemon() changes the current working directory to the root ( /).
If the argument noclose is zero, daemon() redirects 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) | February 27, 2023 | 
 
| Main index | Section 3 | 日本語 | Options | 
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Hang in there, people suffering from natural disasters and deadly diseases - we're putting ribbons on our cars as fast as we can | ” | 
| — Artur Bagyants | ||