From dbefe37a3a8bd8c9e5fcf2b5b7df464851edade2 Mon Sep 17 00:00:00 2001 From: xinhaiteng Date: Mon, 21 Aug 2023 11:03:56 +0800 Subject: [PATCH] sigqueue: add signal type judgment logic To determine whether a signal is real-time signal or standard signal, the POSIX standard https://www.man7.org/linux/man-pages/man7/signal.7.html defines a real-time signal between SIGRTMIN and SIGRTMAX , which can store multiple copies, otherwise only one can be retained. Signed-off-by: xinhaiteng --- sched/signal/sig_dispatch.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 2bffa2f29a..13459a20fa 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -193,13 +193,20 @@ static FAR sigpendq_t *nxsig_alloc_pendingsignal(void) ****************************************************************************/ static FAR sigpendq_t * - nxsig_find_pendingsignal(FAR struct task_group_s *group, int signo) +nxsig_find_pendingsignal(FAR struct task_group_s *group, int signo) { FAR sigpendq_t *sigpend = NULL; irqstate_t flags; DEBUGASSERT(group != NULL); + /* Determining whether a signal is reliable or unreliable */ + + if (SIGRTMIN <= signo && signo <= SIGRTMAX) + { + return sigpend; + } + /* Pending signals can be added from interrupt level. */ flags = enter_critical_section();