pass siginfo_t and ucontext_t to signal handlers
This commit is contained in:
@@ -50,7 +50,7 @@ SaveSignals::~SaveSignals()
|
||||
static void SigHandler( int signal, siginfo_t *si, void *ucp )
|
||||
{
|
||||
for(unsigned i = 0; i < handlers.size(); ++i)
|
||||
handlers[i]( signal );
|
||||
handlers[i]( signal, si, (const ucontext_t *) ucp );
|
||||
}
|
||||
|
||||
static int find_stack_direction2( char *p )
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define SIGNAL_HANDLER_H
|
||||
|
||||
#include <signal.h>
|
||||
#include <ucontext.h>
|
||||
|
||||
class SaveSignals
|
||||
{
|
||||
@@ -14,7 +15,7 @@ public:
|
||||
|
||||
namespace SignalHandler
|
||||
{
|
||||
typedef void (*handler)(int);
|
||||
typedef void (*handler)( int, siginfo_t *si, const ucontext_t *uc );
|
||||
|
||||
void OnClose(handler);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user