BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnCoreDumpGuard.h
Go to the documentation of this file.
1
#ifndef BMNCOREDUMPGUARD_H
2
#define BMNCOREDUMPGUARD_H 1
3
4
#include "
Rtypes.h
"
5
6
/** Class preventing 'core.*' dumps when a BmnRoot process is terminated by a fatal signal.
7
** The guard is installed automatically when the library is loaded, so no changes in the macros are required.
8
** It works regardless of the 'ulimit -c' value and of the /proc/sys/kernel/core_pattern setting, which makes it
9
** usable on the user machines as well as on the cluster nodes. **/
10
class
BmnCoreDumpGuard
11
{
12
public
:
13
// install the guard for the fatal signals which are still processed by the system;
14
// it is called automatically at the library loading, unless the ENABLE_CORE_DUMP environment variable is set
15
// return value: true - the guard is installed, false - the core dumps are requested by ENABLE_CORE_DUMP
16
static
bool
Install
();
17
// restore the default behaviour for the signals taken by Install(), i.e. let the system write the core dump again
18
// return value: true - the guard was installed and is removed now, false - there was nothing to remove
19
static
bool
Uninstall
();
20
// whether the guard is installed
21
static
bool
IsInstalled
() {
return
fgIsInstalled
; }
22
23
private
:
24
BmnCoreDumpGuard
() {}
25
~BmnCoreDumpGuard
() {}
26
27
// whether the guard is installed for at least one signal
28
static
bool
fgIsInstalled
;
29
30
ClassDef
(
BmnCoreDumpGuard
, 1)
31
};
32
33
#endif
Rtypes.h
ClassDef
#define ClassDef(name, id)
BmnCoreDumpGuard
Class preventing 'core.
Definition
BmnCoreDumpGuard.h:11
BmnCoreDumpGuard::IsInstalled
static bool IsInstalled()
Definition
BmnCoreDumpGuard.h:21
BmnCoreDumpGuard::fgIsInstalled
static bool fgIsInstalled
Definition
BmnCoreDumpGuard.h:28
BmnCoreDumpGuard::Uninstall
static bool Uninstall()
BmnCoreDumpGuard::~BmnCoreDumpGuard
~BmnCoreDumpGuard()
Definition
BmnCoreDumpGuard.h:25
BmnCoreDumpGuard::Install
static bool Install()
BmnCoreDumpGuard::BmnCoreDumpGuard
BmnCoreDumpGuard()
Definition
BmnCoreDumpGuard.h:24
install
include
BmnCoreDumpGuard.h
Generated on
for BmnRoot by
1.17.0