Identify source of signal - Linux

This is a discussion on Identify source of signal - Linux ; hi all, I have a program that receives a signal and handles it. Now I am in the situation that the signal can come from 2 differen sources: can I identify in my handler the source of the signal? (for ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Identify source of signal

  1. Identify source of signal

    hi all,

    I have a program that receives a signal and handles it.

    Now I am in the situation that the signal can come from
    2 differen sources: can I identify in my handler the
    source of the signal? (for example the pid of the
    task that lanched the signal?)

    thanks
    giammy


  2. Re: Identify source of signal

    Hi!

    Did you see man 2 sigaction?
    You can get a sender's pid through siginfo_t which passed to
    sa_sigaction.


    giangiammy wrote:
    > hi all,
    >
    > I have a program that receives a signal and handles it.
    >
    > Now I am in the situation that the signal can come from
    > 2 differen sources: can I identify in my handler the
    > source of the signal? (for example the pid of the
    > task that lanched the signal?)
    >
    > thanks
    > giammy



  3. Re: Identify source of signal

    thanks,
    it's exactly what I needed!

    giammy


    Alexander Krizhanovsky wrote:
    > Hi!
    >
    > Did you see man 2 sigaction?
    > You can get a sender's pid through siginfo_t which passed to
    > sa_sigaction.
    >
    >



+ Reply to Thread