E-MailRelay
Static Public Member Functions | List of all members
G::Daemon Class Reference

A static interface for daemonising the calling process. More...

#include <gdaemon.h>

Static Public Member Functions

static void detach ()
 Detaches from the parent environment. More...
 
static void detach (const G::Path &pid_file)
 Does a detach() but the calling process waits a while for the pid file to be created before it exits. More...
 

Detailed Description

A static interface for daemonising the calling process.

Daemonisation includes fork()ing, detaching from the controlling terminal, setting the process umask, etc. The windows implementation does nothing.

See also
G::Process

Definition at line 42 of file gdaemon.h.

Member Function Documentation

◆ detach() [1/2]

void G::Daemon::detach ( )
static

Detaches from the parent environment.

This typically involves fork()ing, std::_Exit()ing the parent, and calling setsid() in the child. See also G::PidFile.

Definition at line 49 of file gdaemon_unix.cpp.

◆ detach() [2/2]

void G::Daemon::detach ( const G::Path pid_file)
static

Does a detach() but the calling process waits a while for the pid file to be created before it exits.

Definition at line 55 of file gdaemon_unix.cpp.


The documentation for this class was generated from the following files: