Figure out PID.

Submitted by jelari
on June 3, 2008 - 3:07am

I have a C code which captures SIGUSR1, SIGTERM signals. Is there any possible way to figure out which process has send the signal to it, in signal handler?..

Regards,
-jelari-

See sigaction, and look at

Igmar Palsenberg (not verified)
on
June 3, 2008 - 6:54am

See sigaction, and look at the siginfo_t structure.

See the manpage of

gat3way (not verified)
on
June 3, 2008 - 7:00am

See the manpage of sigaction()

Hint: the signal handler function's second parameter is of type siginfo_t, which is a structure having the pid_t of the sending process' pid.

Hi, thanks , i got it done

jelari
on
June 3, 2008 - 7:12am

Hi,
thanks , i got it done through sigaction () and sigqueue() to send payload.

-Happy Coding -
Regards,
Jelari.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.