From e935bc53bb72f7333fb8570dc043bf2f8fd92b29 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Wed, 25 Oct 2023 15:42:05 +0300 Subject: [PATCH] task/task_spawnparms.c: Set the new process's signal mask Set the newly spawned process's signal mask, if the caller has instructed to do so by setting POSIX_SPAWN_SETSIGMASK. This is called after the task has been created but has NOT been started yet. --- sched/task/task_spawnparms.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index 6db333cde3..cf231b78c9 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -149,6 +149,17 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) * return an error value, then we would also have to stop the task. */ + /* Firstly, set the signal mask if requested to do so */ + + if ((attr->flags & POSIX_SPAWN_SETSIGMASK) != 0) + { + FAR struct tcb_s *tcb = nxsched_get_tcb(pid); + if (tcb) + { + tcb->sigprocmask = attr->sigmask; + } + } + /* If we are only setting the priority, then call sched_setparm() * to set the priority of the of the new task. */