Lines Matching +full:loss +full:- +full:of +full:- +full:signal
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
11 // notice, this list of conditions and the following disclaimer in the
13 // * Neither the name of Google Inc. nor the names of its contributors
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include <signal.h>
50 /// The number of the signal managed by this programmer.
53 /// Whether the signal is currently programmed by us or not.
56 /// The signal handler that we replaced; to be restored on unprogramming.
59 /// Initializes the internal implementation of the programmer.
61 /// \param signo_ The signal number.
77 /// Programs a signal handler.
79 /// \param signo The signal for which to install the handler.
82 /// \throw signals::system_error If there is an error programming the signal.
91 if (::sigaction(_pimpl->signo, &sa, &_pimpl->old_sa) == -1) { in programmer()
93 throw system_error(F("Could not install handler for signal %s") % in programmer()
94 _pimpl->signo, original_errno); in programmer()
96 _pimpl->programmed = true; in programmer()
100 /// Destructor; unprograms the signal handler if still programmed.
106 if (_pimpl->programmed) { in ~programmer()
107 LW("Destroying still-programmed signals::programmer object"); in ~programmer()
117 /// Unprograms the signal handler.
119 /// \pre The signal handler is programmed (i.e. this can only be called once).
121 /// \throw system_error If unprogramming the signal failed. If this happens,
122 /// the signal is left programmed, this object forgets about the signal and
127 PRE(_pimpl->programmed); in unprogram()
131 _pimpl->programmed = false; in unprogram()
133 if (::sigaction(_pimpl->signo, &_pimpl->old_sa, NULL) == -1) { in unprogram()
135 throw system_error(F("Could not reset handler for signal %s") % in unprogram()
136 _pimpl->signo, original_errno); in unprogram()