BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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. **/
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:
26
27 // whether the guard is installed for at least one signal
28 static bool fgIsInstalled;
29
31};
32
33#endif
#define ClassDef(name, id)
Class preventing 'core.
static bool IsInstalled()
static bool fgIsInstalled
static bool Uninstall()
static bool Install()