1 //===-- SysSignal.cpp -------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Created by Greg Clayton on 6/18/07.
11 //===----------------------------------------------------------------------===//
13 #include "SysSignal.h"
17 const char *SysSignal::Name(int signal
) {
20 return "SIGHUP"; // 1 hangup
22 return "SIGINT"; // 2 interrupt
24 return "SIGQUIT"; // 3 quit
26 return "SIGILL"; // 4 illegal instruction (not reset when caught)
28 return "SIGTRAP"; // 5 trace trap (not reset when caught)
30 return "SIGABRT"; // 6 abort()
31 #if defined(_POSIX_C_SOURCE)
33 return "SIGPOLL"; // 7 pollable event ([XSR] generated, not supported)
34 #else // !_POSIX_C_SOURCE
36 return "SIGEMT"; // 7 EMT instruction
37 #endif // !_POSIX_C_SOURCE
39 return "SIGFPE"; // 8 floating point exception
41 return "SIGKILL"; // 9 kill (cannot be caught or ignored)
43 return "SIGBUS"; // 10 bus error
45 return "SIGSEGV"; // 11 segmentation violation
47 return "SIGSYS"; // 12 bad argument to system call
49 return "SIGPIPE"; // 13 write on a pipe with no one to read it
51 return "SIGALRM"; // 14 alarm clock
53 return "SIGTERM"; // 15 software termination signal from kill
55 return "SIGURG"; // 16 urgent condition on IO channel
57 return "SIGSTOP"; // 17 sendable stop signal not from tty
59 return "SIGTSTP"; // 18 stop signal from tty
61 return "SIGCONT"; // 19 continue a stopped process
63 return "SIGCHLD"; // 20 to parent on child stop or exit
65 return "SIGTTIN"; // 21 to readers pgrp upon background tty read
67 return "SIGTTOU"; // 22 like TTIN for output if (tp->t_local<OSTOP)
68 #if !defined(_POSIX_C_SOURCE)
70 return "SIGIO"; // 23 input/output possible signal
73 return "SIGXCPU"; // 24 exceeded CPU time limit
75 return "SIGXFSZ"; // 25 exceeded file size limit
77 return "SIGVTALRM"; // 26 virtual time alarm
79 return "SIGPROF"; // 27 profiling time alarm
80 #if !defined(_POSIX_C_SOURCE)
82 return "SIGWINCH"; // 28 window size changes
84 return "SIGINFO"; // 29 information request
87 return "SIGUSR1"; // 30 user defined signal 1
89 return "SIGUSR2"; // 31 user defined signal 2