@@ -45,7 +45,13 @@ using namespace CorUnix;
45
45
46
46
SET_DEFAULT_DEBUG_CHANNEL (EXCEPT);
47
47
48
+ #ifdef SIGRTMIN
48
49
#define INJECT_ACTIVATION_SIGNAL SIGRTMIN
50
+ #endif
51
+
52
+ #if !defined(INJECT_ACTIVATION_SIGNAL) && defined(FEATURE_HIJACK)
53
+ #error FEATURE_HIJACK requires INJECT_ACTIVATION_SIGNAL to be defined
54
+ #endif
49
55
50
56
/* local type definitions *****************************************************/
51
57
@@ -70,7 +76,9 @@ static void sigquit_handler(int code, siginfo_t *siginfo, void *context);
70
76
static void common_signal_handler (PEXCEPTION_POINTERS pointers, int code,
71
77
native_context_t *ucontext);
72
78
79
+ #ifdef INJECT_ACTIVATION_SIGNAL
73
80
static void inject_activation_handler (int code, siginfo_t *siginfo, void *context);
81
+ #endif
74
82
75
83
static void handle_signal (int signal_id, SIGFUNC sigfunc, struct sigaction *previousAction);
76
84
static void restore_signal (int signal_id, struct sigaction *previousAction);
@@ -125,7 +133,9 @@ BOOL SEHInitializeSignals()
125
133
handle_signal (SIGINT, sigint_handler, &g_previous_sigint);
126
134
handle_signal (SIGQUIT, sigquit_handler, &g_previous_sigquit);
127
135
136
+ #ifdef INJECT_ACTIVATION_SIGNAL
128
137
handle_signal (INJECT_ACTIVATION_SIGNAL, inject_activation_handler, NULL );
138
+ #endif
129
139
130
140
/* The default action for SIGPIPE is process termination.
131
141
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)
484
494
kill (gPID , code);
485
495
}
486
496
497
+ #ifdef INJECT_ACTIVATION_SIGNAL
487
498
/* ++
488
499
Function :
489
500
inject_activation_handler
@@ -523,6 +534,7 @@ static void inject_activation_handler(int code, siginfo_t *siginfo, void *contex
523
534
}
524
535
}
525
536
}
537
+ #endif
526
538
527
539
/* ++
528
540
Function :
@@ -538,6 +550,7 @@ Parameters :
538
550
--*/
539
551
PAL_ERROR InjectActivationInternal (CorUnix::CPalThread* pThread)
540
552
{
553
+ #ifdef INJECT_ACTIVATION_SIGNAL
541
554
int status = pthread_kill (pThread->GetPThreadSelf (), INJECT_ACTIVATION_SIGNAL);
542
555
if (status != 0 )
543
556
{
@@ -550,6 +563,9 @@ PAL_ERROR InjectActivationInternal(CorUnix::CPalThread* pThread)
550
563
}
551
564
552
565
return NO_ERROR;
566
+ #else
567
+ return ERROR_CANCELLED;
568
+ #endif
553
569
}
554
570
555
571
/* ++
0 commit comments