Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

makedaemon.h File Reference

Defines the make_daemon() function which turns a process into a daemon. More...

#include <stdexcept>

Include dependency graph for makedaemon.h:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  Dv
namespace  Dv::Util

Functions

void make_daemon (const std::string &pidfilename="") throw (std::runtime_error)
 Make this process into a daemon.


Detailed Description

Defines the make_daemon() function which turns a process into a daemon.

Tested on linux (using daemon()) and solaris.

Definition in file makedaemon.h.


Function Documentation

void make_daemon const std::string &  pidfilename = ""  )  throw (std::runtime_error)
 

Make this process into a daemon.

Become process session leader, close fd 0,1,2, no controlling terminal, chdir("/");

Parameters:
pidfilename to which pid of daemon process will be written if the size of the filename is not 0.
Exceptions:
runtime_error upon error.


dvutil-0.13.15 [30 December, 2004]