Process Information

Hi,

If we have a process p1 running and then p2 attempts to shutdown p1. Is there a means for p1 to know who has requested him to shutdown

Thanks and regards,
Reji

Yes, most signal handleing routines have some form of data structure that tells you the name of the sending process. The example data structure from linux (below) from the sigaction man page provides a glimpse into how this is done in one OS: