BSD 4_4 development
[unix-history] / usr / share / man / cat3 / daemon.0
CommitLineData
8bb980a3
C
1DAEMON(3) BSD Programmer's Manual DAEMON(3)
2
3N\bNA\bAM\bME\bE
4 d\bda\bae\bem\bmo\bon\bn - run in the background
5
6S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
7 d\bda\bae\bem\bmo\bon\bn(_\bi_\bn_\bt _\bn_\bo_\bc_\bh_\bd_\bi_\br, _\bi_\bn_\bt _\bn_\bo_\bc_\bl_\bo_\bs_\be);
8
9D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
10 The d\bda\bae\bem\bmo\bon\bn() function is for programs wishing to detach themselves from
11 the controlling terminal and run in the background as system daemons.
12
13 Unless the argument _\bn_\bo_\bc_\bh_\bd_\bi_\br is non-zero, d\bda\bae\bem\bmo\bon\bn() changes the current
14 working directory to the root (``/'').
15
16 Unless the argument _\bn_\bo_\bc_\bl_\bo_\bs_\be is non-zero, d\bda\bae\bem\bmo\bon\bn() will redirect standard
17 input, standard output and standard error to ``/dev/null''.
18
19E\bER\bRR\bRO\bOR\bRS\bS
20 The function d\bda\bae\bem\bmo\bon\bn() may fail and set _\be_\br_\br_\bn_\bo for any of the errors speci-
21 fied for the library functions fork(2) and setsid(2).
22
23S\bSE\bEE\bE A\bAL\bLS\bSO\bO
24 setsid(2)
25
26H\bHI\bIS\bST\bTO\bOR\bRY\bY
27 The d\bda\bae\bem\bmo\bon\bn() function first appeared in 4.4BSD.
28
294.4BSD June 9, 1993 1