1DAEMON(3) Library Functions Manual DAEMON(3)
2
3
4
6 daemon - run in the background
7
9 int
10 daemon(nochdir, noclose)
11 int nochdir, noclose;
12
14 The daemon function is for programs wishing to detach themselves from
15 the controlling terminal and run in the background as system daemons.
16
17 Unless the argument nochdir is non-zero, daemon changes the current
18 working directory to the root (``/'').
19
20 Unless the argument noclose is non-zero, daemon will redirect standard
21 input, standard output and standard error to ``/dev/null''.
22
24 The function daemon may fail and set errno for any of the errors speciā
25 fied for the library functions fork(2).
26
28 fork(2), ioctl(2).
29
31 The daemon function first appeared in 4.4BSD.
32
33
34
354th Berkeley Distribution February 3, 1995 DAEMON(3)