libexcept
1.1.19
Stack trace along C++ exceptions
libexcept
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
44
namespace
libexcept
45
{
46
47
48
49
typedef
std::list<int>
sig_list_t
;
50
51
52
class
scoped_signal_mask
53
{
54
public
:
55
typedef
std::shared_ptr<scoped_signal_mask>
pointer_t
;
56
57
scoped_signal_mask
(
sig_list_t
block_signals =
sig_list_t
());
58
~scoped_signal_mask
();
59
60
private
:
61
bool
f_set
=
false
;
62
sigset_t
f_original_mask
= sigset_t();
63
};
64
65
66
bool
has_sanitizer
();
67
68
69
70
}
71
// namespace libexcept
72
// vim: ts=4 sw=4 et
libexcept::scoped_signal_mask
Definition
scoped_signal_mask.h:53
libexcept::scoped_signal_mask::f_original_mask
sigset_t f_original_mask
Definition
scoped_signal_mask.h:62
libexcept::scoped_signal_mask::~scoped_signal_mask
~scoped_signal_mask()
Reset signal mask the way it was before the constructor was called.
Definition
scoped_signal_mask.cpp:142
libexcept::scoped_signal_mask::pointer_t
std::shared_ptr< scoped_signal_mask > pointer_t
Definition
scoped_signal_mask.h:55
libexcept::scoped_signal_mask::f_set
bool f_set
Definition
scoped_signal_mask.h:61
libexcept
Definition
version.h:27
libexcept::has_sanitizer
bool has_sanitizer()
Check whether this instance is running with the sanitizer.
Definition
scoped_signal_mask.cpp:169
libexcept::sig_list_t
std::list< int > sig_list_t
Definition
scoped_signal_mask.h:49
This document is part of the
Snap! Websites Project
.
Copyright by
Made to Order Software Corp.