Crypto++ 8.9
Free C++ class library of cryptographic schemes
|
Signal handler for Linux and Unix compatibles. More...
#include <ossig.h>
Public Member Functions | |
SignalHandler (SignalHandlerFn pfn=NULL, int flags=0) | |
Construct a signal handler. | |
Signal handler for Linux and Unix compatibles.
S | Signal number |
O | Flag indicating if an existing handler should be overwritten |
SignalHandler() can be used to install a signal handler with the signature void handler_fn(int)
. If SignalHandlerFn
is not NULL
, then the sigaction is set to the function and the sigaction flags is set to the flags. If SignalHandlerFn
is NULL
, then a default handler is installed using sigaction flags set to 0. The default handler only returns from the call.
Upon destruction the previous signal handler is restored if the former signal handler was replaced.
On Cygwin systems using Newlib, you should define _XOPEN_SOURCE=700
or _GNU_SOURCE
; or use -std=gnu++03
, -std=gnu++11
, or similar. If you compile with -std=c++03
, -std=c++11
or similar, then define _XOPEN_SOURCE=700
.
setjmp
or longjmp
because the destructor may not run.
|
inline |
Construct a signal handler.
pfn | Pointer to a signal handler function |
flags | Flags to use with the signal handler |
SignalHandler() installs a signal handler with the signature void handler_fn(int)
. If SignalHandlerFn
is not NULL
, then the sigaction is set to the function and the sigaction flags is set to the flags. If SignalHandlerFn
is NULL
, then a default handler is installed using sigaction flags set to 0. The default handler only returns from the call.
Upon destruction the previous signal handler is restored if the former signal handler was overwritten.
On Cygwin systems using Newlib, you should define _XOPEN_SOURCE=700
or _GNU_SOURCE
; or use -std=gnu++03
, -std=gnu++11
, or similar. If you compile with -std=c++03
, -std=c++11
or similar, then define _XOPEN_SOURCE=700
.
setjmp
or longjmp
because the destructor may not run. setjmp
is why cpu.cpp does not use SignalHandler during CPU feature testing.
|
inline |