Home | History | Annotate | Download | only in runtime
      1 // Copyright 2011 The Go Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style
      3 // license that can be found in the LICENSE file.
      4 
      5 package runtime
      6 
      7 type sigTabT struct {
      8 	flags int
      9 	name  string
     10 }
     11 
     12 // Incoming notes are compared against this table using strncmp, so the
     13 // order matters: longer patterns must appear before their prefixes.
     14 // There are _SIG constants in os2_plan9.go for the table index of some
     15 // of these.
     16 //
     17 // If you add entries to this table, you must respect the prefix ordering
     18 // and also update the constant values is os2_plan9.go.
     19 var sigtable = [...]sigTabT{
     20 	// Traps that we cannot be recovered.
     21 	{_SigThrow, "sys: trap: debug exception"},
     22 	{_SigThrow, "sys: trap: invalid opcode"},
     23 
     24 	// We can recover from some memory errors in runtimesigpanic.
     25 	{_SigPanic, "sys: trap: fault read addr"},  // SIGRFAULT
     26 	{_SigPanic, "sys: trap: fault write addr"}, // SIGWFAULT
     27 
     28 	// We can also recover from math errors.
     29 	{_SigPanic, "sys: trap: divide error"}, // SIGINTDIV
     30 	{_SigPanic, "sys: fp:"},                // SIGFLOAT
     31 
     32 	// All other traps are normally handled as if they were marked SigThrow.
     33 	// We mark them SigPanic here so that debug.SetPanicOnFault will work.
     34 	{_SigPanic, "sys: trap:"}, // SIGTRAP
     35 
     36 	// Writes to a closed pipe can be handled if desired, otherwise they're ignored.
     37 	{_SigNotify, "sys: write on closed pipe"},
     38 
     39 	// Other system notes are more serious and cannot be recovered.
     40 	{_SigThrow, "sys:"},
     41 
     42 	// Issued to all other procs when calling runtimeexit.
     43 	{_SigGoExit, "go: exit "},
     44 
     45 	// Kill is sent by external programs to cause an exit.
     46 	{_SigKill, "kill"},
     47 
     48 	// Interrupts can be handled if desired, otherwise they cause an exit.
     49 	{_SigNotify + _SigKill, "interrupt"},
     50 	{_SigNotify + _SigKill, "hangup"},
     51 
     52 	// Alarms can be handled if desired, otherwise they're ignored.
     53 	{_SigNotify, "alarm"},
     54 }
     55