Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: signals after exec

by afoken (Chancellor)
on Aug 26, 2017 at 09:00 UTC ( [id://1198054]=note: print w/replies, xml ) Need Help??


in reply to Re: signals after exec
in thread signals after exec

"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". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1198054]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found