github.com/reiver/go@v0.0.0-20150109200633-1d0c7792f172/src/runtime/signal_plan9.go (about) 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 []byte 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, []byte("sys: trap: debug exception")}, 22 {_SigThrow, []byte("sys: trap: invalid opcode")}, 23 24 // We can recover from some memory errors in runtime·sigpanic. 25 {_SigPanic, []byte("sys: trap: fault read addr")}, // SIGRFAULT 26 {_SigPanic, []byte("sys: trap: fault write addr")}, // SIGWFAULT 27 28 // We can also recover from math errors. 29 {_SigPanic, []byte("sys: trap: divide error")}, // SIGINTDIV 30 {_SigPanic, []byte("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, []byte("sys: trap:")}, // SIGTRAP 35 36 // Writes to a closed pipe can be handled if desired, otherwise they're ignored. 37 {_SigNotify, []byte("sys: write on closed pipe")}, 38 39 // Other system notes are more serious and cannot be recovered. 40 {_SigThrow, []byte("sys:")}, 41 42 // Issued to all other procs when calling runtime·exit. 43 {_SigGoExit, []byte("go: exit ")}, 44 45 // Kill is sent by external programs to cause an exit. 46 {_SigKill, []byte("kill")}, 47 48 // Interrupts can be handled if desired, otherwise they cause an exit. 49 {_SigNotify + _SigKill, []byte("interrupt")}, 50 {_SigNotify + _SigKill, []byte("hangup")}, 51 52 // Alarms can be handled if desired, otherwise they're ignored. 53 {_SigNotify, []byte("alarm")}, 54 }