System programming is really about dealing closely with operating system resources, creating processes, threads, releasing resources, and much more. There are cases where we need a process to run indefinitely; that is, a process first offers some services or manages a resource, and then it keeps running all the time. A process that runs indefinitely in the background is called a daemon. This recipe will show how a daemon could be spawned programmatically.
Creating a daemon process
How to do it...
As mentioned, a daemon is a process that runs indefinitely. A process, in order to be classified as a daemon, must have some well-defined properties that will be shown in this recipe with a program.
- Type the following...