[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 20/30] bsd-user/signal.c: core_dump_signal
|
From: |
Warner Losh |
|
Subject: |
[PATCH 20/30] bsd-user/signal.c: core_dump_signal |
|
Date: |
Sun, 9 Jan 2022 09:19:13 -0700 |
Returns 1 for signals that cause core files.
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Kyle Evans <kevans@freebsd.org>
Signed-off-by: Warner Losh <imp@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
[PATCH 22/30] bsd-user/signal.c: Fill in queue_signal, Warner Losh, 2022/01/09
[PATCH 26/30] bsd-user/signal.c: tswap_siginfo, Warner Losh, 2022/01/09