This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new dbefe37a3a sigqueue: add signal type judgment logic
dbefe37a3a is described below
commit dbefe37a3a8bd8c9e5fcf2b5b7df464851edade2
Author: xinhaiteng <[email protected]>
AuthorDate: Mon Aug 21 11:03:56 2023 +0800
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 <[email protected]>
---
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();