1 /* Licensed under BSD-MIT - see LICENSE file for details */
2 #ifndef CCAN_DAEMONIZE_H
3 #define CCAN_DAEMONIZE_H
7 * daemonize - turn this process into a daemon.
9 * This routine forks us off to become a daemon. It returns false on failure
10 * (eg. fork(), chdir or open failed) and sets errno.
12 * Side effects for programmers to be aware of:
13 * - PID changes (our parent exits, we become child of init)
14 * - stdin and stdout file descriptors are closed
15 * - stderr is reopened to /dev/null so you don't reuse it
16 * - Current working directory changes to /
17 * - Umask is set to 0.
21 #endif /* CCAN_DAEMONIZE_H */