Regarding Signal IPC

Daniel Eischen deischen at freebsd.org
Fri Jun 19 13:03:30 UTC 2009


On Fri, 19 Jun 2009, vasanth raonaik wrote:

> Hello Hackers,
>
> I want to print out the process ID of the process which is sending the
> Signal.
>
> Is it possible. if yes, can you please point me to any related documents.

Though I have not tried this, there is an si_pid field
(and other fields you might be interested in) in
struct siginfo.  If you use a POSIX signal handler
(see sigaction(2)), a pointer to a struct siginfo is
the 2nd argument to your signal handler.

See <sys/signal.h> for the definition of struct siginfo.

-- 
DE


More information about the freebsd-hackers mailing list