Added a generic mechanism to set up hooks for dispatching signal
handlers outside ntdll.
diff --git a/dlls/ntdll/signal_sparc.c b/dlls/ntdll/signal_sparc.c
index e5eaec7..257c14d 100644
--- a/dlls/ntdll/signal_sparc.c
+++ b/dlls/ntdll/signal_sparc.c
@@ -40,8 +40,23 @@
WINE_DEFAULT_DEBUG_CHANNEL(seh);
+typedef int (*wine_signal_handler)(unsigned sig);
+
+static wine_signal_handler handlers[256];
+
static sigset_t all_sigs;
+
+/***********************************************************************
+ * dispatch_signal
+ */
+inline static int dispatch_signal(unsigned sig)
+{
+ if (handlers[sig] == NULL) return 0;
+ return handlers[sig](sig);
+}
+
+
/*
* FIXME: All this works only on Solaris for now
*/
@@ -310,8 +325,7 @@
*/
static void int_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
{
- extern int CONSOLE_HandleCtrlC(void);
- if (!CONSOLE_HandleCtrlC())
+ if (!dispatch_signal(SIGINT))
{
EXCEPTION_RECORD rec;
CONTEXT context;
@@ -347,6 +361,18 @@
/***********************************************************************
+ * __wine_set_signal_handler (NTDLL.@)
+ */
+int __wine_set_signal_handler(unsigned sig, wine_signal_handler wsh)
+{
+ if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1;
+ if (handlers[sig] != NULL) return -2;
+ handlers[sig] = wsh;
+ return 0;
+}
+
+
+/***********************************************************************
* SIGNAL_Unblock
*
* Unblock signals. Called from EXC_RtlRaiseException.