summaryrefslogtreecommitdiff
path: root/src/pal/src/exception/signal.cpp
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2016-02-02 02:37:06 +0100
committerKamil Rytarowski <n54@gmx.com>2016-02-07 13:45:28 +0100
commit652335e3de29e1c0752282ca9e1a988662af375b (patch)
treefce1e1e40869a3e58647feebd1ed56676c5eb850 /src/pal/src/exception/signal.cpp
parent64744ed7e7581bb42841ce2554da73d736bb7013 (diff)
downloadcoreclr-652335e3de29e1c0752282ca9e1a988662af375b.tar.gz
coreclr-652335e3de29e1c0752282ca9e1a988662af375b.tar.bz2
coreclr-652335e3de29e1c0752282ca9e1a988662af375b.zip
Disable FEATURE_HIJACK in NetBSD as unimplemented
Solution suggested by Jan Kotas (Microsoft).
Diffstat (limited to 'src/pal/src/exception/signal.cpp')
-rw-r--r--src/pal/src/exception/signal.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
index 9f9945f3cb..b4841c0b34 100644
--- a/src/pal/src/exception/signal.cpp
+++ b/src/pal/src/exception/signal.cpp
@@ -45,7 +45,13 @@ using namespace CorUnix;
SET_DEFAULT_DEBUG_CHANNEL(EXCEPT);
+#ifdef SIGRTMIN
#define INJECT_ACTIVATION_SIGNAL SIGRTMIN
+#endif
+
+#if !defined(INJECT_ACTIVATION_SIGNAL) && defined(FEATURE_HIJACK)
+#error FEATURE_HIJACK requires INJECT_ACTIVATION_SIGNAL to be defined
+#endif
/* local type definitions *****************************************************/
@@ -70,7 +76,9 @@ static void sigquit_handler(int code, siginfo_t *siginfo, void *context);
static void common_signal_handler(PEXCEPTION_POINTERS pointers, int code,
native_context_t *ucontext);
+#ifdef INJECT_ACTIVATION_SIGNAL
static void inject_activation_handler(int code, siginfo_t *siginfo, void *context);
+#endif
static void handle_signal(int signal_id, SIGFUNC sigfunc, struct sigaction *previousAction);
static void restore_signal(int signal_id, struct sigaction *previousAction);
@@ -125,7 +133,9 @@ BOOL SEHInitializeSignals()
handle_signal(SIGINT, sigint_handler, &g_previous_sigint);
handle_signal(SIGQUIT, sigquit_handler, &g_previous_sigquit);
+#ifdef INJECT_ACTIVATION_SIGNAL
handle_signal(INJECT_ACTIVATION_SIGNAL, inject_activation_handler, NULL);
+#endif
/* The default action for SIGPIPE is process termination.
Since SIGPIPE can be signaled when trying to write on a socket for which
@@ -484,6 +494,7 @@ static void sigquit_handler(int code, siginfo_t *siginfo, void *context)
kill(gPID, code);
}
+#ifdef INJECT_ACTIVATION_SIGNAL
/*++
Function :
inject_activation_handler
@@ -523,6 +534,7 @@ static void inject_activation_handler(int code, siginfo_t *siginfo, void *contex
}
}
}
+#endif
/*++
Function :
@@ -538,6 +550,7 @@ Parameters :
--*/
PAL_ERROR InjectActivationInternal(CorUnix::CPalThread* pThread)
{
+#ifdef INJECT_ACTIVATION_SIGNAL
int status = pthread_kill(pThread->GetPThreadSelf(), INJECT_ACTIVATION_SIGNAL);
if (status != 0)
{
@@ -550,6 +563,9 @@ PAL_ERROR InjectActivationInternal(CorUnix::CPalThread* pThread)
}
return NO_ERROR;
+#else
+ return ERROR_CANCELLED;
+#endif
}
/*++