views:

52

answers:

2

If I have a process that receives signals from other processes, is there a way for me to somehow tell which process (if any) sent a signal?

strace lets me trace which signals a process has received, but doesn't allow me to trace who issued them.

+3  A: 

Not from outside the process. The second argument to the signal handler is a siginfo_t structure which contains the PID of the sending process as one of its members. See sigaction(2) for more details.

Ignacio Vazquez-Abrams
A: 

Ptrace can be used to detect sender too. There is an ptrace(GETSIGINFO) call, which will give a debugger a chance to read (and, possibly, change) siginto_t struct.

osgx