aboutsummaryrefslogblamecommitdiffstats
path: root/util/system/daemon.h
blob: b00793b9c97451c13fc70fb643cf2419d7929eb3 (plain) (tree)
1
2
3
4
5
6
7
8
            
 



                            
 



                            
 



                      




                                                                                                                                                         
                           
 
#pragma once

namespace NDaemonMaker {
    enum ECloseDescriptors {
        closeAll = 0,
        closeStdIoOnly
    };

    enum EStdIoDescriptors {
        openNone = 0,
        openDevNull,
        openYandexStd
    };

    enum EChDir {
        chdirNone = 0,
        chdirRoot
    };

    enum EParent {
        callExitFromParent = 0,
        returnFromParent
    };

    bool MakeMeDaemon(ECloseDescriptors cd = closeAll, EStdIoDescriptors iod = openDevNull, EChDir chd = chdirRoot, EParent parent = callExitFromParent);
    void CloseFrom(int fd);
}