[PATCH 15/16] bsd-user: Add SIGSYS to core dump signals.

Warner Losh posted 16 patches 2 years, 10 months ago
Maintainers: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>
There is a newer version of this series
[PATCH 15/16] bsd-user: Add SIGSYS to core dump signals.
Posted by Warner Losh 2 years, 10 months ago
SIGSYS creates a core by default if uncaught. Follow that here. Sort
with the same order as is in the kernel.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/signal.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index f4e078ee1da..4301595cc2f 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -330,17 +330,22 @@ int block_signals(void)
     return qatomic_xchg(&ts->signal_pending, 1);
 }
 
-/* Returns 1 if given signal should dump core if not handled. */
+/*
+ * Returns 1 if given signal should dump core if not handled.
+ * Compare with kern_sig.c sigproptbl[].
+ */
 static int core_dump_signal(int sig)
 {
     switch (sig) {
+    case TARGET_SIGQUIT:
+    case TARGET_SIGILL:
+    case TARGET_SIGTRAP:
     case TARGET_SIGABRT:
+    case TARGET_SIGEMT:
     case TARGET_SIGFPE:
-    case TARGET_SIGILL:
-    case TARGET_SIGQUIT:
     case TARGET_SIGSEGV:
-    case TARGET_SIGTRAP:
     case TARGET_SIGBUS:
+    case TARGET_SIGSYS:
         return 1;
     default:
         return 0;
-- 
2.40.0
Re: [PATCH 15/16] bsd-user: Add SIGSYS to core dump signals.
Posted by Richard Henderson 2 years, 10 months ago
On 4/5/23 14:36, Warner Losh wrote:
> SIGSYS creates a core by default if uncaught. Follow that here. Sort
> with the same order as is in the kernel.
> 
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
>   bsd-user/signal.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~