sigaction: Expand si_user for non-kernel signals

Commit 9244b5a737 added support
for non-standard field si_user that is useful for passing context
pointers to signal handlers.

This commits makes it work for all signals, not just SA_KERNELHAND.
Previously si_user for normal signals was uninitialized garbage.
This commit is contained in:
Petteri Aimonen 2023-11-22 15:48:04 +02:00 committed by Xiang Xiao
parent 59cf308eff
commit 0648a61668
3 changed files with 3 additions and 1 deletions

View File

@ -390,7 +390,7 @@ struct sigaction
} sa_u;
sigset_t sa_mask;
int sa_flags;
FAR void *sa_user;
FAR void *sa_user; /* Passed to siginfo.si_user (non-standard) */
};
/* Definitions that adjust the non-standard naming */

View File

@ -101,6 +101,7 @@ static int nxsig_queue_action(FAR struct tcb_s *stcb, siginfo_t *info)
}
memcpy(&sigq->info, info, sizeof(siginfo_t));
sigq->info.si_user = sigact->act.sa_user;
/* Put it at the end of the pending signals list */

View File

@ -101,6 +101,7 @@ int nxsig_queue(int pid, int signo, union sigval value)
info.si_pid = rtcb->pid;
info.si_status = OK;
#endif
info.si_user = NULL; /* Will be set in sig_dispatch.c */
/* Send the signal */