Tor  0.4.7.0-alpha-dev
torerr_sys.c
Go to the documentation of this file.
1 /* Copyright (c) 2018-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * \file torerr_sys.c
6  * \brief Subsystem object for the error handling subsystem.
7  **/
8 
9 #include "orconfig.h"
10 #include "lib/err/backtrace.h"
11 #include "lib/err/torerr.h"
12 #include "lib/err/torerr_sys.h"
13 #include "lib/subsys/subsys.h"
14 #include "lib/version/torversion.h"
15 
16 #include <stddef.h>
17 
18 static int
19 subsys_torerr_initialize(void)
20 {
22  return -1;
24 
25  return 0;
26 }
27 static void
28 subsys_torerr_shutdown(void)
29 {
30  /* Stop handling signals with backtraces, then flush the logs. */
33 }
34 
35 const subsys_fns_t sys_torerr = {
36  .name = "err",
38  /* Low-level error handling is a diagnostic feature, we want it to init
39  * right after windows process security, and shutdown last.
40  * (Security never shuts down.) */
41  .level = -99,
42  .supported = true,
43  .initialize = subsys_torerr_initialize,
44  .shutdown = subsys_torerr_shutdown
45 };
int configure_backtrace_handler(const char *tor_version)
Definition: backtrace.c:330
void clean_up_backtrace_handler(void)
Definition: backtrace.c:359
Header for backtrace.c.
const char * name
Definition: subsys.h:43
Types used to declare a subsystem.
#define SUBSYS_DECLARE_LOCATION()
Definition: subsys.h:211
void tor_log_flush_sigsafe_err_fds(void)
Definition: torerr.c:161
void tor_log_reset_sigsafe_err_fds(void)
Definition: torerr.c:147
Headers for torerr.c.
Declare subsystem object for torerr.c.
Header for version.c.
const char * get_version(void)
Definition: version.c:38