1

I have read this discussion which discuss about how to check the signal actions of each process: How can I check what signals a process is listening to?

However, I want to use C/C++, Python or other ways to get the userspace of the signal handler name of each process. Just like the psig in Solaris: What is the meaning of every column when executing psig command?

Would it be possible to do that in Linux?

2 Answers 2

1

The signal function returns a pointer to the existing handler, if any. You can set a signal to a known value, get the existing handler's address and restore it.

2
0

Using sigaction instead of signal makes it possible to request the current signal handler without setting another handler. You just need to pass NULL as the second argument:

Please see this answer for a code example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .