github.com/razvanm/vanadium-go-1.3@v0.0.0-20160721203343-4a65068e5915/src/runtime/signals_plan9.h (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 #include "textflag.h" 6 7 #define N SigNotify 8 #define K SigKill 9 #define T SigThrow 10 #define P SigPanic 11 #define E SigGoExit 12 13 // Incoming notes are compared against this table using strncmp, so the 14 // order matters: longer patterns must appear before their prefixes. 15 // There are #defined SIG constants in os_plan9.h for the table index of 16 // some of these. 17 // 18 // If you add entries to this table, you must respect the prefix ordering 19 // and also update the constant values is os_plan9.h. 20 21 #pragma dataflag NOPTR 22 SigTab runtime·sigtab[] = { 23 // Traps that we cannot be recovered. 24 T, "sys: trap: debug exception", 25 T, "sys: trap: invalid opcode", 26 27 // We can recover from some memory errors in runtime·sigpanic. 28 P, "sys: trap: fault read addr", // SIGRFAULT 29 P, "sys: trap: fault write addr", // SIGWFAULT 30 31 // We can also recover from math errors. 32 P, "sys: trap: divide error", // SIGINTDIV 33 P, "sys: fp:", // SIGFLOAT 34 35 // All other traps are normally handled as if they were marked SigThrow. 36 // We mark them SigPanic here so that debug.SetPanicOnFault will work. 37 P, "sys: trap:", // SIGTRAP 38 39 // Writes to a closed pipe can be handled if desired, otherwise they're ignored. 40 N, "sys: write on closed pipe", 41 42 // Other system notes are more serious and cannot be recovered. 43 T, "sys:", 44 45 // Issued to all other procs when calling runtime·exit. 46 E, "go: exit ", 47 48 // Kill is sent by external programs to cause an exit. 49 K, "kill", 50 51 // Interrupts can be handled if desired, otherwise they cause an exit. 52 N+K, "interrupt", 53 N+K, "hangup", 54 55 // Alarms can be handled if desired, otherwise they're ignored. 56 N, "alarm", 57 }; 58 59 #undef N 60 #undef K 61 #undef T 62 #undef P 63 #undef E