Sender of signal

Is it possible, from within a signal handler, to know what process/thread
sent the signal?

  • Mario

sure…

in siginfo_t look at si_pid


Mario Charest <mcharest@antispam_zinformatic.com> wrote:


Is it possible, from within a signal handler, to know what process/thread
sent the signal?

  • Mario


Randy Martin randy@qnx.com
Manager of FAE Group, North America
QNX Software Systems www.qnx.com
175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
Tel: 613-591-0931 Fax: 613-591-3579

Oh just like QNX4 then, a “hiden” parameter to the signal handler?
Is this POSIX?

Some of our processes are receiving stop signal are we wan’t to investigate
who send it. The doc mentions SIGSTOP and SIGKILL can’t be
trapped, under QNX4 it was possible with some extra steps.
Is there a way around that in NTO.

sure…

in siginfo_t look at si_pid


Mario Charest <mcharest@antispam_zinformatic.com> wrote:


Is it possible, from within a signal handler, to know what
process/thread
sent the signal?

  • Mario





    Randy Martin > randy@qnx.com
    Manager of FAE Group, North America
    QNX Software Systems > www.qnx.com
    175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
    Tel: 613-591-0931 Fax: 613-591-3579

it is documented with the sig* routines… i don’t believe the intention was
ever to hide it.

with STOP/CONT/KILL the key there is that signals can only come in if the
client has permission… so a lowly app can’t sigstop a root app for example.

but i know of no way of trapping them …

Mario Charest <mcharest@antispam_zinformatic.com> wrote:

Oh just like QNX4 then, a “hiden” parameter to the signal handler?
Is this POSIX?

Some of our processes are receiving stop signal are we wan’t to investigate
who send it. The doc mentions SIGSTOP and SIGKILL can’t be
trapped, under QNX4 it was possible with some extra steps.
Is there a way around that in NTO.

in siginfo_t look at si_pid


Mario Charest <mcharest@antispam_zinformatic.com> wrote:


Is it possible, from within a signal handler, to know what
process/thread
sent the signal?

  • Mario





    Randy Martin > randy@qnx.com
    Manager of FAE Group, North America
    QNX Software Systems > www.qnx.com
    175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
    Tel: 613-591-0931 Fax: 613-591-3579


Randy Martin randy@qnx.com
Manager of FAE Group, North America
QNX Software Systems www.qnx.com
175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
Tel: 613-591-0931 Fax: 613-591-3579

Randy, Mario,

If your app is amenable to being run within gdb, I believe you might be
able to catch the unstoppable signals with gdb’s signal handler and not have
it pass it on to the app. You may then be able to determine who is sending
the signal. It’s been a while since I used this trick so I don’t recall if
the unstoppables are catchable in gdb…

Lonnie VanZandt
QNX Sr. FAE

“Randy Martin” <randy@qnx.com> wrote in message
news:9du558$baj$1@nntp.qnx.com

it is documented with the sig* routines… i don’t believe the intention
was
ever to hide it.

with STOP/CONT/KILL the key there is that signals can only come in if the
client has permission… so a lowly app can’t sigstop a root app for
example.

but i know of no way of trapping them …

Mario Charest <mcharest@antispam_zinformatic.com> wrote:

Oh just like QNX4 then, a “hiden” parameter to the signal handler?
Is this POSIX?

Some of our processes are receiving stop signal are we wan’t to
investigate
who send it. The doc mentions SIGSTOP and SIGKILL can’t be
trapped, under QNX4 it was possible with some extra steps.
Is there a way around that in NTO.

in siginfo_t look at si_pid


Mario Charest <mcharest@antispam_zinformatic.com> wrote:


Is it possible, from within a signal handler, to know what
process/thread
sent the signal?

  • Mario





    Randy Martin > randy@qnx.com
    Manager of FAE Group, North America
    QNX Software Systems > www.qnx.com
    175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
    Tel: 613-591-0931 Fax: 613-591-3579





    Randy Martin > randy@qnx.com
    Manager of FAE Group, North America
    QNX Software Systems > www.qnx.com
    175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
    Tel: 613-591-0931 Fax: 613-591-3579