F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FatalHandlerComponentLinuxImpl.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FatalHandlerImpl.cpp
3 // \author tcanham
4 // \brief cpp file for FatalHandler component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #include <cstdlib>
14 #include <csignal>
15 #include <Fw/Logger/Logger.hpp>
17 #include <Os/Task.hpp>
18 #include <FpConfig.hpp>
19 
20 namespace Svc {
21 
22  // ----------------------------------------------------------------------
23  // Handler implementations for user-defined typed input ports
24  // ----------------------------------------------------------------------
25 
26  void FatalHandlerComponentImpl::FatalReceive_handler(
27  const NATIVE_INT_TYPE portNum,
28  FwEventIdType Id) {
29  // for **nix, delay then exit with error code
30  Fw::Logger::log("FATAL %d handled.\n",Id);
31  (void)Os::Task::delay(Fw::TimeInterval(1, 0));
32  Fw::Logger::log("Exiting with abort signal and core dump file.\n");
33  (void)raise( SIGABRT );
34  exit(1);
35  }
36 
37 } // end namespace Svc
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
U32 FwEventIdType
Definition: FpConfig.h:103
C++-compatible configuration header for fprime configuration.
static void log(const char *format,...)
log a formated string with supplied arguments
Definition: Logger.cpp:21
static Status delay(Fw::TimeInterval interval)
delay the current task
Definition: Task.cpp:191