33 struct sigaction
Foam::sigInt::oldAction_;
38 void Foam::sigInt::sigHandler(int)
41 if (sigaction(SIGINT, &oldAction_,
nullptr) < 0)
44 <<
"Cannot reset SIGINT trapping" 60 oldAction_.sa_handler =
nullptr;
69 if (sigaction(SIGINT, &oldAction_,
nullptr) < 0)
72 <<
"Cannot reset SIGINT trapping" 82 if (oldAction_.sa_handler)
85 <<
"Cannot call sigInt::set() more than once" 89 struct sigaction newAction;
90 newAction.sa_handler = sigHandler;
91 newAction.sa_flags = SA_NODEFER;
92 sigemptyset(&newAction.sa_mask);
93 if (sigaction(SIGINT, &newAction, &oldAction_) < 0)
96 <<
"Cannot set SIGINT trapping"
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
errorManip< error > abort(error &err)
void set(const bool verbose)
Activate SIGINT signal handler.