Commit | Line | Data |
---|---|---|
8bb980a3 C |
1 | DAEMON(3) BSD Programmer's Manual DAEMON(3) |
2 | ||
3 | N\bNA\bAM\bME\bE | |
4 | d\bda\bae\bem\bmo\bon\bn - run in the background | |
5 | ||
6 | S\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 | ||
9 | D\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 | ||
19 | E\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 | ||
23 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO | |
24 | setsid(2) | |
25 | ||
26 | H\bHI\bIS\bST\bTO\bOR\bRY\bY | |
27 | The d\bda\bae\bem\bmo\bon\bn() function first appeared in 4.4BSD. | |
28 | ||
29 | 4.4BSD June 9, 1993 1 |