Penguin
Annotated edit history of daemon(3) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 DAEMON
2 !!!DAEMON
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 ERRORS
7 SEE ALSO
8 HISTORY
9 ----
10 !!NAME
11
12
13 daemon - run in the background
14 !!SYNOPSIS
15
16
17 __#include __
18
19
20 __int daemon (int__ ''nochdir''__,__ ''int''
21 __noclose);__
22 !!DESCRIPTION
23
24
25 The __daemon__() function is for programs wishing to
26 detach themselves from the controlling terminal and run in
27 the background as system daemons.
28
29
30 Unless the argument ''nochdir'' is non-zero,
31 __daemon__() changes the current working directory to the
32 root (``/'').
33
34
35 Unless the argument ''noclose'' is non-zero,
36 __daemon__() will redirect standard input, standard
37 output and standard error to ''/dev/null''.
38 !!ERRORS
39
40
41 If an error occurs, __daemon__() returns -1 and sets the
42 global variable ''errno'' to any of the errors specified
43 for the library functions fork(2) and
44 setsid(2).
45 !!SEE ALSO
46
47
48 fork(2), setsid(2)
49 !!HISTORY
50
51
52 The __daemon__() function first appeared in
53 BSD4.4.
54 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.