1DAEMON(3)                  Library Functions Manual                  DAEMON(3)
2
3
4

NAME

6       daemon - run in the background
7

SYNOPSIS

9       int
10       daemon(nochdir, noclose)
11           int nochdir, noclose;
12

DESCRIPTION

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

ERRORS

24       The function daemon may fail and set errno for any of the errors speciā€
25       fied for the library functions fork(2).
26

SEE ALSO

28       fork(2), ioctl(2).
29

HISTORY

31       The daemon function first appeared in 4.4BSD.
32
33
34
354th Berkeley Distribution      February 3, 1995                      DAEMON(3)
Impressum