Returns 1 for signals that cause core files.

Signed-off-by: Stacey Son <s...@freebsd.org>
Signed-off-by: Kyle Evans <kev...@freebsd.org>
Signed-off-by: Warner Losh <i...@bsdimp.com>
---
 bsd-user/signal.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index a6e07277fb2..824535be8b8 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -92,6 +92,23 @@ static inline void 
host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
     }
 }
 
+/* Returns 1 if given signal should dump core if not handled. */
+static int core_dump_signal(int sig)
+{
+    switch (sig) {
+    case TARGET_SIGABRT:
+    case TARGET_SIGFPE:
+    case TARGET_SIGILL:
+    case TARGET_SIGQUIT:
+    case TARGET_SIGSEGV:
+    case TARGET_SIGTRAP:
+    case TARGET_SIGBUS:
+        return 1;
+    default:
+        return 0;
+    }
+}
+
 /*
  * Queue a signal so that it will be send to the virtual CPU as soon as
  * possible.
-- 
2.33.1


Reply via email to