|
1 | 1 | //===-- zOSLibFunctions.cpp -----------------------------------------------===// |
2 | | -//// |
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 |
6 | | -//// |
7 | | -////===--------------------------------------------------------------------===// |
| 2 | +// |
| 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 |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
8 | 8 |
|
9 | 9 | //===----------------------------------------------------------------------===// |
10 | 10 | // |
|
18 | 18 | #include <sys/resource.h> |
19 | 19 | #include <sys/wait.h> |
20 | 20 |
|
21 | | - |
22 | 21 | const char *signalName[] = { |
23 | | - /* 0 */ nullptr, |
24 | | - /* 1 */ "Hangup", // SIGHUP |
25 | | - /* 2 */ "Interrupt", // SIGINT |
26 | | - /* 3 */ "Aborted", // SIGABRT |
27 | | - /* 4 */ "Illegal instruction", // SIGILL |
28 | | - /* 5 */ "Polling event", // SIGPOLL |
29 | | - /* 6 */ "Socket data available", // SIGURG |
30 | | - /* 7 */ "Stopped (signal)", // SIGSTOP |
31 | | - /* 8 */ "Floating point exception", // SIGFPE |
32 | | - /* 9 */ "Killed", // SIGKILL |
33 | | - /* 10 */ "Bus error", // SIGBUS |
34 | | - /* 11 */ "Segmentation fault", // SIGSEGV |
35 | | - /* 12 */ "Bad system call", // SIGSYS |
36 | | - /* 13 */ "Broken pipe", // SIGPIPE |
37 | | - /* 14 */ "Alarm clock", // SIGALRM |
38 | | - /* 15 */ "Terminated", // SIGTERM |
39 | | - /* 16 */ "User defined signal 1", // SIGUSR1 |
40 | | - /* 17 */ "User defined signal 2", // SIGUSR2 |
41 | | - /* 18 */ "Abend", // SIGABND |
42 | | - /* 19 */ "Continued", // SIGCONT |
43 | | - /* 20 */ "Child exited", // SIGCHLD |
44 | | - /* 21 */ "Stopped (tty input)", // SIGTTIN |
45 | | - /* 22 */ "Stopped (tty output)", // SIGTTOU |
46 | | - /* 23 */ "I/O complete", // SIGIO |
47 | | - /* 24 */ "Quit", // SIGQUIT |
48 | | - /* 25 */ "Stopped", // SIGTSTP |
49 | | - /* 26 */ "Trace/breakpoint trap", // SIGTRAP |
50 | | - /* 27 */ "I/O error", // SIGIOERR |
51 | | - /* 28 */ "Window changed", // SIGWINCH |
52 | | - /* 29 */ "CPU time limit exceeded", // SIGXCPU |
53 | | - /* 30 */ "File size limit exceeded", // SIGXFSZ |
54 | | - /* 31 */ "Virtual timer expired", // SIGVTALRM |
55 | | - /* 32 */ "Profiling timer expired", // SIGPROF |
56 | | - /* 33 */ "OMVS subsystem shutdown", // SIGDANGER |
57 | | - /* 34 */ "Thread stop", // SIGTHSTOP |
58 | | - /* 35 */ "Thread resume", // SIGTHCONT |
59 | | - /* 36 */ nullptr, |
60 | | - /* 37 */ "Toggle syscall trace", // SIGTRACE |
61 | | - /* 38 */ nullptr, // SIGDCE |
62 | | - /* 39 */ "System dump", // SIGDUMP |
| 22 | + /* 0 */ nullptr, |
| 23 | + /* 1 */ "Hangup", // SIGHUP |
| 24 | + /* 2 */ "Interrupt", // SIGINT |
| 25 | + /* 3 */ "Aborted", // SIGABRT |
| 26 | + /* 4 */ "Illegal instruction", // SIGILL |
| 27 | + /* 5 */ "Polling event", // SIGPOLL |
| 28 | + /* 6 */ "Socket data available", // SIGURG |
| 29 | + /* 7 */ "Stopped (signal)", // SIGSTOP |
| 30 | + /* 8 */ "Floating point exception", // SIGFPE |
| 31 | + /* 9 */ "Killed", // SIGKILL |
| 32 | + /* 10 */ "Bus error", // SIGBUS |
| 33 | + /* 11 */ "Segmentation fault", // SIGSEGV |
| 34 | + /* 12 */ "Bad system call", // SIGSYS |
| 35 | + /* 13 */ "Broken pipe", // SIGPIPE |
| 36 | + /* 14 */ "Alarm clock", // SIGALRM |
| 37 | + /* 15 */ "Terminated", // SIGTERM |
| 38 | + /* 16 */ "User defined signal 1", // SIGUSR1 |
| 39 | + /* 17 */ "User defined signal 2", // SIGUSR2 |
| 40 | + /* 18 */ "Abend", // SIGABND |
| 41 | + /* 19 */ "Continued", // SIGCONT |
| 42 | + /* 20 */ "Child exited", // SIGCHLD |
| 43 | + /* 21 */ "Stopped (tty input)", // SIGTTIN |
| 44 | + /* 22 */ "Stopped (tty output)", // SIGTTOU |
| 45 | + /* 23 */ "I/O complete", // SIGIO |
| 46 | + /* 24 */ "Quit", // SIGQUIT |
| 47 | + /* 25 */ "Stopped", // SIGTSTP |
| 48 | + /* 26 */ "Trace/breakpoint trap", // SIGTRAP |
| 49 | + /* 27 */ "I/O error", // SIGIOERR |
| 50 | + /* 28 */ "Window changed", // SIGWINCH |
| 51 | + /* 29 */ "CPU time limit exceeded", // SIGXCPU |
| 52 | + /* 30 */ "File size limit exceeded", // SIGXFSZ |
| 53 | + /* 31 */ "Virtual timer expired", // SIGVTALRM |
| 54 | + /* 32 */ "Profiling timer expired", // SIGPROF |
| 55 | + /* 33 */ "OMVS subsystem shutdown", // SIGDANGER |
| 56 | + /* 34 */ "Thread stop", // SIGTHSTOP |
| 57 | + /* 35 */ "Thread resume", // SIGTHCONT |
| 58 | + /* 36 */ nullptr, // n/a |
| 59 | + /* 37 */ "Toggle syscall trace", // SIGTRACE |
| 60 | + /* 38 */ nullptr, // SIGDCE |
| 61 | + /* 39 */ "System dump", // SIGDUMP |
63 | 62 | }; |
64 | 63 |
|
65 | 64 | // z/OS Unix System Services does not have strsignal() support, so the |
66 | 65 | // strsignal() function is implemented here. |
67 | 66 | char *strsignal(int sig) { |
68 | | - if (static_cast<size_t>(sig) < sizeof(signalName)/sizeof(signalName[0]) && signalName[sig]) |
| 67 | + if (static_cast<size_t>(sig) < (sizeof(signalName) / sizeof(signalName[0])) && |
| 68 | + signalName[sig]) |
69 | 69 | return const_cast<char *>(signalName[sig]); |
70 | 70 | static char msg[256]; |
71 | 71 | sprintf(msg, "Unknown signal %d", sig); |
|
0 commit comments