Repository navigation
Expand file tree
/
Copy pathSignalList.cpp
More file actions
92 lines (85 loc) · 1.94 KB
/
Copy pathSignalList.cpp
File metadata and controls
92 lines (85 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstddef>
#include <cstdint>
#include <cstring>
extern "C" {
extern const char* const sys_siglist_nid_postfix[32] = {
"Signal 0",
"Hangup",
"Interrupt",
"Quit",
"Illegal instruction",
"Trace/BPT trap",
"Abort trap",
"EMT trap",
"Floating point exception",
"Killed",
"Bus error",
"Segmentation fault",
"Bad system call",
"Broken pipe",
"Alarm clock",
"Terminated",
"Urgent I/O condition",
"Suspended (signal)",
"Suspended",
"Continued",
"Child exited",
"Stopped (tty input)",
"Stopped (tty output)",
"I/O possible",
"Cputime limit exceeded",
"Filesize limit exceeded",
"Virtual timer expired",
"Profiling timer expired",
"Window size changes",
"Information request",
"User defined signal 1",
"User defined signal 2",
};
extern const int sys_nsig_nid_postfix = sizeof(sys_siglist_nid_postfix) / sizeof(sys_siglist_nid_postfix[0]);
extern const char* const sys_signame_nid_postfix[32] = {
"Signal 0",
"HUP",
"INT",
"QUIT",
"ILL",
"TRAP",
"ABRT",
"EMT",
"FPE",
"KILL",
"BUS",
"SEGV",
"SYS",
"PIPE",
"ALRM",
"TERM",
"URG",
"STOP",
"TSTP",
"CONT",
"CHLD",
"TTIN",
"TTOU",
"IO",
"XCPU",
"XFSZ",
"VTALRM",
"PROF",
"WINCH",
"INFO",
"USR1",
"USR2",
};
std::int64_t APS5_VABI _write_nid_postfix(int descriptor, const void* buffer, std::size_t count);
void APS5_VABI psignal_nid_postfix(unsigned int signal, const char* prefix) {
const char* const message = signal < 32 ? sys_siglist_nid_postfix[signal] : "Unknown signal";
if (prefix != nullptr && prefix[0] != 0) {
_write_nid_postfix(2, prefix, std::strlen(prefix));
_write_nid_postfix(2, ": ", 2);
}
_write_nid_postfix(2, message, std::strlen(message));
_write_nid_postfix(2, "\n", 1);
}
}