Python Forum

Full Version: SIG_DFL handling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a question on what happens when a signal (eg: SIGTERM) has the default signal handler (SIG_DFL)

Situation: I want to add my own *additional* signal handlers to a signal. But I don't want to cause any unintended consequences.

The question is if SIG_DFL implies some sort of default system behavior (handled by the python interpreter or the OS itself). If it does, then my signal handler needs to do my own thing, then restore SIG_DFL and reraise.

If SIG_DFL means that the behavior is not set (and won't do anything important), then there is no need for me to restore SIG_DFL and re-raise.

Any insight?