tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sigqueue code paths



Hi guys,

   I spent some time investigating the sigqueue code path, which is used by
realtime signals,
but I am confused about some logics,
please provide comments if you have specific knowledge about this part.
I followed the call chain path of sigqueue, and pretty confident about how
a signal is generated and put into a queue, but not sure how a signal is
consumed. Followings are some details.
When we used sigqueue, netbsd will invoke
sys_sigqueueinfo->kill1->kpsignal2(assume we just want to send signal to a
process)->sigput  & sigpost.

Basically, sigput will put a signal into a queue specific to a process, and
sigpost will change the running status of a process and notify proper
process to handle the signal.
In terms of consuming a signal, I saw there was function call sigclearall,
which takes all signals from the queue and prepare to consume. I searched
all related calls to sigclearall, it seems it is invoked when executing
exec, exit functions. It seems not the correct callers to sigclearall when
running a simple program like,
https://github.com/ycui1984/posixtestsuite/blob/master/conformance/interfaces/sigqueue/9-1.cI
guess there will be some routines that are called when a process is running
on a processor.
It may find the running flag is set with pending signals and then start to
operate signals, but
I cannot find the signal consumer code path. Any ideas on this?


Thanks Charles


Home | Main Index | Thread Index | Old Index