cppannotations/yo/concrete/daemon.yo
fbbrokken 6881bc3814 The trunk directory contains the latest version (6.4.0c) of the C++
Annotations. 

The branches and tags directory are empty, since I couldn't
svnadmin import a repostitory dump. Many earlier versions exist, though, and
if you want the full archive, just let me know and I'll send you the svnadmin
dump of my full C++ Annotations archive.

Frank B. Brokken <f.b.brokken@rug.nl>



git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@3 f6dd340e-d3f9-0310-b409-bdd246841980
2006-09-04 08:26:34 +00:00

14 lines
953 B
Text

Applications exist in which the only purpose of ti(fork()) is to start a
child process. The parent process terminates immediately after spawning the
child process. If this happens, the child process continues to run as a child
process of ti(init), the always running first process on i(Unix) systems. Such
a process is often called a emi(daemon), running as a i(background process).
Although the following example can easily be constructed as a plain bf(C)
program, it was included in the bf(C++) Annotations because it is so closely
related to the current discussion of the tt(Fork) class. I thought about
adding a tt(daemon()) member to that class, but eventually decided against it
because the construction of a daemon program is very simple and requires no
features other than those currently offered by the class tt(Fork). Here is an
example illustrating the construction of a daemon program:
verbinclude(concrete/examples/daemon.cc)