Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Meaning of $SIG{...} = 'DEFAULT';

by repellent (Priest)
on Aug 28, 2008 at 19:44 UTC ( #707576=perlquestion: print w/ replies, xml ) Need Help??
repellent has asked for the wisdom of the Perl Monks concerning the following question:

In perlipc:
    You may also choose to assign the strings 'IGNORE' or 'DEFAULT' as the handler, in which case Perl will try to discard the signal or do the default thing.
What does it mean by "do the default thing"? Where can I get documentation on 'DEFAULT' behaviors for different signals, if any?

Comment on Meaning of $SIG{...} = 'DEFAULT';
Select or Download Code
Re: Meaning of $SIG{...} = 'DEFAULT';
by JadeNB (Chaplain) on Aug 28, 2008 at 19:50 UTC
    perlipc says that Perl's handling of signals is based on the signal(3) function from the C library, so I imagine that man 3 signal—in particular, the 'default action' column—will give the information you want.
Re: Meaning of $SIG{...} = 'DEFAULT';
by Anonymous Monk on Aug 29, 2008 at 06:31 UTC
    What does it mean by "do the default thing"?

    Test it :D

    # $SIG{...} = sub {warn "NOT DEFAULT " ...}; # commented out to see d +efault
Re: Meaning of $SIG{...} = 'DEFAULT';
by repellent (Priest) on Aug 29, 2008 at 08:59 UTC
    FYI: I have compiled a list of signals and their numbers, with brief descriptions. There may be differences in signal numbers depending on the platform. If there is only one signal number stated, then it is the same for all the platforms. The alphabetic [A-F] legends are at the bottom.
    alpha/sparc, i386/ppc, mips SIGHUP 1 A Hangup detected on controlling terminal or death of controlling process SIGINT 2 A Interrupt from keyboard (Ctrl-C) SIGQUIT 3 C Quit from keyboard SIGILL 4 C Illegal Instruction SIGTRAP 5 C Trace/breakpoint trap SIGABRT 6 C Abort signal from abort SIGBUS 10, 7,10 C Bus error (bad memory access) SIGFPE 8 C Floating point exception SIGKILL 9 AEF Kill (cannot be caught or ignored) SIGUSR1 30,10,16 A User-defined signal 1 SIGSEGV 11 C Invalid memory reference SIGUSR2 31,12,17 A User-defined signal 2 SIGPIPE 13 A Broken pipe: write to pipe with no readers SIGALRM 14 A Timer signal from alarm SIGTERM 15 A Termination (termination signal from SIGKILL +) SIGSTKFLT -,16, - A Stack fault on coprocessor SIGCHLD 20,17,18 B Child stopped or terminated SIGCONT 19,18,25 Continue if stopped SIGSTOP 17,19,23 DEF Stop process SIGTSTP 18,20,24 D Stop typed at tty SIGTTIN 21,21,26 D tty input for background process SIGTTOU 22,22,27 D tty output for background process SIGURG 16,23,21 B Urgent condition on socket (4.2 BSD) SIGXCPU 24,24,30 C CPU time limit exceeded (4.2 BSD) SIGXFSZ 25,25,31 C File size limit exceeded (4.2 BSD) SIGVTALRM 26,26,28 A Virtual alarm clock (4.2 BSD) SIGPROF 27,27,29 A Profiling timer expired SIGIO 23,29,22 A I/O now possible (4.2 BSD) SIGWINCH 28,28,20 B Window resize signal (4.3 BSD, Sun) SIGPWR 29,30,19 A Power failure (System V) SIGUNUSED -,31, - A Unused signal (will be SIGSYS) SIGCLD -, -,18 A [synonym for SIGCHLD] SIGIOT 6 C IOT trap [synonym for SIGABRT] SIGINFO 29, -, - A [synonym for SIGPWR] SIGPOLL 23,29,22 A Pollable event (Sys V) [synonym for SIGIO] SIGEMT 7, -, 7 A SIGLOST -, -, - A File lock lost SIGSYS 12, -,12 C Bad argument to routine (SVID) A = default action terminate process B = default action ignore signal C = default action terminate process and dump core D = default action stop process E = signal cannot be caught F = signal cannot be ignored

      You forgot the most important ones.

      Unix Error Messages At the USENIX Association conference in Atlanta recently (Ed: 1985/198 +6) a contest was held to invent the most humorous/bizarre/etc. UN*X error + message of the errno(2) 'EERROR' type. This contest had been tried at +an earlier European Users Group meeting, where the winning entry was ENOTOBACCO - Read on an empty pipe You get the idea. A partial (alphabetized) list of 'top(?)' entries fr +om Atlanta (and from several readers of hp.unix) follows; if your pun/wei +rdness tolerance is low, you may want to abandon ship: EBEFOREI - Invalid syntax ECHERNOBYL - Core dumped ECRAY - Program exited before being run EDINGDONG - The daemon is dead EFLAT - System needs tuning EGEEK - Program written by inept Frat member EIEIO - Here-a-bug, there-a-bug, .... EIUD - Missing period ELECTROLUX - Your code could stand to be cleaned up EMILYPOST - Wrong fork END.ARMS.CONTROL - Silo overflow ENOHORSE - Mount failed ENONSEQUITUR - C program not derived from main(){printf("Hello, world" +);} EWATERGATE - Extended tape gap EWOK - Aliens sighted EWOK - Your code appears to have been stir-fried EWOULDBNICE - The feature you want has not been implemented yet And finally, a sort-of 'period piece': EMR.ED - A host is a host, From coast to coast And nobody talks to a host that's close, Unless the host that isn't close Is busy, hung, or dead. I would also like this new signal to be supported: SIGNUKE - Nuclear event occurred (cannot be caught or ignored :-)

      :) :) :)

      
      -- 
      Human history becomes more and more a race between education and catastrophe. -- HG Wells
      

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://707576]
Approved by olus
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-08-21 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (134 votes), past polls