daemon.h 584 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. namespace NDaemonMaker {
  3. enum ECloseDescriptors {
  4. closeAll = 0,
  5. closeStdIoOnly
  6. };
  7. enum EStdIoDescriptors {
  8. openNone = 0,
  9. openDevNull,
  10. openYandexStd
  11. };
  12. enum EChDir {
  13. chdirNone = 0,
  14. chdirRoot
  15. };
  16. enum EParent {
  17. callExitFromParent = 0,
  18. returnFromParent
  19. };
  20. bool MakeMeDaemon(ECloseDescriptors cd = closeAll, EStdIoDescriptors iod = openDevNull, EChDir chd = chdirRoot, EParent parent = callExitFromParent);
  21. void CloseFrom(int fd);
  22. } // namespace NDaemonMaker