33 void waitfor(
const G::Path & pid_file )
35 if( !pid_file.
empty() )
37 for(
int i = 0 ; i < 100 ; i++ )
41 std::this_thread::sleep_for( std::chrono::milliseconds(10) ) ;
61 DaemonImp::waitfor( pid_file ) ;
72void G::Daemon::setsid()
74 GDEF_IGNORE_RETURN ::setsid() ;
static void detach()
Detaches from the parent environment.
static bool exists(const Path &file)
Returns true if the file (directory, device etc.) exists.
static std::pair< bool, pid_t > fork()
A utility function that forks the calling process and returns twice; once in the parent and once in t...
A Path object represents a file system path.
bool empty() const noexcept
Returns true if the path is empty.
static void cd(const Path &dir)
Changes directory.