libexcept 1.1.19
Stack trace along C++ exceptions
scoped_signal_mask.h
Go to the documentation of this file.
1// Copyright (c) 2019-2025 Made to Order Software Corp. All Rights Reserved
2//
3// https://snapwebsites.org/
4// contact@m2osw.com
5//
6// Permission is hereby granted, free of charge, to any person obtaining a
7// copy of this software and associated documentation files (the
8// "Software"), to deal in the Software without restriction, including
9// without limitation the rights to use, copy, modify, merge, publish,
10// distribute, sublicense, and/or sell copies of the Software, and to
11// permit persons to whom the Software is furnished to do so, subject to
12// the following conditions:
13//
14// The above copyright notice and this permission notice shall be included
15// in all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24#pragma once
25
32// C++
33//
34#include <list>
35#include <memory>
36
37
38// C
39//
40#include <signal.h>
41
42
43
44namespace libexcept
45{
46
47
48
49typedef std::list<int> sig_list_t;
50
51
53{
54public:
55 typedef std::shared_ptr<scoped_signal_mask> pointer_t;
56
57 scoped_signal_mask(sig_list_t block_signals = sig_list_t());
59
60private:
61 bool f_set = false;
62 sigset_t f_original_mask = sigset_t();
63};
64
65
66bool has_sanitizer();
67
68
69
70}
71// namespace libexcept
72// vim: ts=4 sw=4 et
~scoped_signal_mask()
Reset signal mask the way it was before the constructor was called.
std::shared_ptr< scoped_signal_mask > pointer_t
bool has_sanitizer()
Check whether this instance is running with the sanitizer.
std::list< int > sig_list_t

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.