Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Global SIG handler: Is this advisable? Is there a better way?

by cdarke (Prior)
on Aug 29, 2006 at 15:05 UTC ( [id://570226]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Global SIG handler: Is this advisable? Is there a better way?

Excuse me for pointing this out if you already know, but it is not possible to trap ALL signals, many cannot be trapped. The most obvious is KILL, but there are others like SEGV, BUS, FPE, ILL, etc.
The default action of USR1 and USR2 is not to terminate the process, they are benign, so I have to wonder why you are trapping those. Also beware of trapping CHLD, its behaviour (like some others) varies across platforms (*nix's).
  • Comment on Re: Global SIG handler: Is this advisable? Is there a better way?

Replies are listed 'Best First'.
Re^2: Global SIG handler: Is this advisable? Is there a better way?
by snafu (Chaplain) on Aug 29, 2006 at 16:52 UTC
    Indeed. And I was thinking that even though I am attempting to trap all signals that even the ones that can't be trapped will not be trapped with my code. I'm thinking that it doesn't hurt anything to trap those signals, though. Right?

    The USR1 signal that I'm trapping is actually being trapped for a function purpose of my program that is not clearly obvious from my posted code but you're right, however, that there is no real reason to trap it either unless there is a specific reason. In my case, for this code, there is. :)

    Now the CHLD signal you mention is a very interesting case that I didn't think about before. So, I will consider this in my existing code. Thank you!

    _ _ _ _ _ _ _ _ _ _
    - Jim
    Insert clever comment here...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://570226]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.