00001 #ifndef DVUTIL_MAKEDAEMON_H 00002 #define DVUTIL_MAKEDAEMON_H 00003 // $Id: makedaemon.h,v 1.7 2003/03/12 13:33:52 dvermeir Exp $ 00004 #include <stdexcept> 00005 /** \file 00006 * Defines the make_daemon() function which turns a 00007 * process into a daemon. Tested on linux (using daemon()) 00008 * and solaris. 00009 */ 00010 namespace Dv { 00011 namespace Util { 00012 /** Make this process into a daemon. 00013 * Become process session leader, close fd 0,1,2, no controlling 00014 * terminal, chdir("/"); 00015 * @param pidfilename to which pid of daemon process will be written 00016 * if the size of the filename is not 0. 00017 * @exception runtime_error upon error. 00018 */ 00019 void make_daemon(const std::string& pidfilename="") throw (std::runtime_error); 00020 } } 00021 #endif
dvutil-1.0.10 | [ 5 December, 2009] |