From f47ff76589811abfc8534ca3303b7b50f99a2001 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Thu, 4 Sep 2025 20:51:57 +0800 Subject: [PATCH] signal: add default sigaction for SIGURG according to the posix standard: the default action for SIGURG is to ignore the signal, we need to add the default sigaction handler for SIGURG this fix the /tset/ANSI.os/signal/signal_X/T.signal_X testcase Signed-off-by: guoshichao --- sched/Kconfig | 9 +++++++++ sched/signal/sig_default.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/sched/Kconfig b/sched/Kconfig index 5339e2b7507..efa15d24db7 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1671,6 +1671,15 @@ config SIG_SIGPOLL_ACTION Backward compatible behavior would require that the application use sigaction() to ignore SIGPOLL. +config SIG_SIGURG_ACTION + bool "SIGURG" + default n + ---help--- + Enable the default action for SIGURG (ignore the signal) + Make sure that your applications are expecting this POSIX behavior. + Backward compatible behavior would require that the application use + sigaction() to ignore SIGURG. + endif # SIG_DEFAULT endmenu # Signal Configuration diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c index 957ce3b2dca..1d027362324 100644 --- a/sched/signal/sig_default.c +++ b/sched/signal/sig_default.c @@ -149,6 +149,9 @@ static const struct nxsig_defaction_s g_defactions[] = #ifdef CONFIG_SIG_SIGPOLL_ACTION { SIGPOLL, 0, nxsig_abnormal_termination }, #endif +#ifdef CONFIG_SIG_SIGURG_ACTION + { SIGURG, 0, nxsig_null_action }, +#endif }; #define NACTIONS (sizeof(g_defactions) / sizeof(struct nxsig_defaction_s))