go ahead... be a heretic | |
PerlMonks |
Re^2: signals after execby afoken (Chancellor) |
on Aug 26, 2017 at 09:00 UTC ( [id://1198054]=note: print w/replies, xml ) | Need Help?? |
"the dispositions of handled signals are reset to the default; the dispositions of ignored signals are left unchanged." ... and if you think about it, it makes sense. Ignoring a signal just sets a flag somewhere in the process structure managed by the kernel. The same is true for the other default actions terminate, terminate and dump core, stop and continue. Custom signal handlers, i.e. every signal handler somewhere in the code of the process, are overwritten by exec() (Remember: exec() replaces the executable in the current process with a different one), and so the signal handler pointers would point to some nonsense. If exec() would not reset the signal handlers, invoking the first custom signal handler would crash the executable (by executing unrelated code). Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|