signals.h 722 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <util/system/defaults.h>
  3. #include <util/system/sigset.h>
  4. #include <util/system/pipe.h>
  5. #include <signal.h>
  6. namespace NYql {
  7. #ifdef _win_
  8. using sig_atomic_t = int;
  9. #endif
  10. extern volatile sig_atomic_t NeedTerminate;
  11. extern volatile sig_atomic_t NeedQuit;
  12. extern volatile sig_atomic_t NeedReconfigure;
  13. extern volatile sig_atomic_t NeedReopenLog;
  14. extern volatile sig_atomic_t NeedReapZombies;
  15. extern volatile sig_atomic_t NeedInterrupt;
  16. extern TPipe SignalPipeW;
  17. extern TPipe SignalPipeR;
  18. void InitSignals();
  19. void InitSignalsWithSelfPipe();
  20. void CatchInterruptSignal(bool doCatch);
  21. void SigSuspend(const sigset_t* mask);
  22. void AllowAnySignals();
  23. bool HasPendingQuitOrTerm();
  24. } // namespace NYql