#include <cpp-terminal/private/signals.hpp>
Definition at line 21 of file signals.hpp.
◆ Signals()
Term::Private::Signals::Signals |
( |
std::vector< sighandler_t > & | m_han | ) |
|
|
noexcept |
Definition at line 28 of file signals.cpp.
29{
30 const static std::vector<int> ignore{
31#if defined(SIGCONT)
32 SIGCONT,
33#endif
34#if defined(SIGSTOP)
35 SIGSTOP,
36#endif
37#if defined(SIGTSTP)
38 SIGTSTP,
39#endif
40#if defined(SIGTTIN)
41 SIGTTIN,
42#endif
43#if defined(SIGTTOU)
44 SIGTTOU,
45#endif
46 };
49 {
50
51
53
54 m_han.push_back(old);
55
56
57
58
59
60
61 }
62}
static const std::size_t m_signals_number
void(*)(int) sighandler_t
◆ ~Signals()
Term::Private::Signals::~Signals |
( |
| ) |
|
|
inlinenoexcept |
◆ reset_and_raise()
Definition at line 64 of file signals.cpp.
65{
66 const static std::vector<int> termin{
67#if defined(SIGHUP)
68 SIGHUP,
69#endif
70#if defined(SIGHUP)
71 SIGINT,
72#endif
73#if defined(SIGQUIT)
74 SIGQUIT,
75#endif
76#if defined(SIGQUIT)
77 SIGILL,
78#endif
79#if defined(SIGTRAP)
80 SIGTRAP,
81#endif
82#if defined(SIGTRAP)
83 SIGABRT,
84#endif
85#if defined(SIGIOT)
86 SIGIOT,
87#endif
88#if defined(SIGBUS)
89 SIGBUS,
90#endif
91#if defined(SIGBUS)
92 SIGFPE,
93#endif
94#if defined(SIGKILL)
95 SIGKILL,
96#endif
97#if defined(SIGUSR1)
98 SIGUSR1,
99#endif
100#if defined(SIGSEGV)
101 SIGSEGV,
102#endif
103#if defined(SIGUSR2)
104 SIGUSR2,
105#endif
106#if defined(SIGUSR2)
107 SIGPIPE,
108#endif
109#if defined(SIGALRM)
110 SIGALRM,
111#endif
112#if defined(SIGSTKFLT)
113 SIGSTKFLT,
114#endif
115#if defined(SIGCONT)
116 SIGCONT,
117#endif
118#if defined(SIGXCPU)
119 SIGXCPU,
120#endif
121#if defined(SIGXFSZ)
122 SIGXFSZ,
123#endif
124#if defined(SIGVTALRM)
125 SIGVTALRM,
126#endif
127#if defined(SIGPROF)
128 SIGPROF,
129#endif
130#if defined(SIGPROF)
131 SIGIO,
132#endif
133#if defined(SIGPOLL)
134 SIGPOLL,
135#endif
136#if defined(SIGPWR)
137 SIGPWR,
138#endif
139#if defined(SIGSYS)
140 SIGSYS,
141#endif
142#if defined(SIGUNUSED)
143 SIGUNUSED,
144#endif
145#if defined(SIGUNUSED)
146 SIGUNUSED,
147#endif
148#if defined(SIGTERM)
149 SIGTERM
150#endif
151 };
152 if(std::find(termin.begin(), termin.end(), sign) != termin.end())
153 {
155 old = std::signal(sign, m_han[sign]);
157 std::raise(sign);
158 }
159}
◆ setHandler()
void Term::Private::Signals::setHandler |
( |
const sighandler_t & | handler | ) |
|
|
noexcept |
◆ m_signals_number
const std::size_t Term::Private::Signals::m_signals_number {NSIG - 1} |
|
staticprivate |
The documentation for this class was generated from the following files: