irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_signal.cpp
Go to the documentation of this file.
1 #include "irods_signal.hpp"
2 #include "irods_stacktrace.hpp"
3 
4 #include <string.h>
5 #include <signal.h>
6 #include <cstdlib>
7 
8 #include <iostream>
9 
10 // Define signal handlers for irods
11 
12 extern "C" {
13 
15  static void segv_handler(
16  int signal ) {
17  std::cerr << "Caught signal [" << signal << "]. Dumping stacktrace and exiting" << std::endl;
18  std::cerr << irods::stacktrace().dump();
19  exit(signal);
20  }
21 
22  void register_handlers( void ) {
23  struct sigaction action;
24  memset(&action, 0, sizeof(action));
25  action.sa_handler = segv_handler;
26  sigaction( SIGSEGV, &action, 0 );
27  sigaction( SIGABRT, &action, 0 );
28  sigaction( SIGINT, &action, 0 );
29  }
30 }
register_handlers
void register_handlers(void)
Definition: irods_signal.cpp:22
irods::stacktrace::dump
const std::string & dump() const
Definition: irods_stacktrace.cpp:55
irods_stacktrace.hpp
irods::stacktrace
Definition: irods_stacktrace.hpp:11
irods_signal.hpp
run_tests.action
action
Definition: run_tests.py:114
segv_handler
static void segv_handler(int signal)
Definition: irods_signal.cpp:15