Skip to content

Commit

Permalink
task/task_spawnparms.c: Set the new process's signal mask
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pussuw committed Oct 26, 2023
1 parent 7622b2b commit 4a72063
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sched/task/task_spawnparms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 4a72063

Please sign in to comment.