Page MenuHomeFreeBSD

D35215.id106079.diff
No OneTemporary

D35215.id106079.diff

Index: lib/libsysdecode/signal.c
===================================================================
--- lib/libsysdecode/signal.c
+++ lib/libsysdecode/signal.c
@@ -32,6 +32,10 @@
#include <stdio.h>
#include <sysdecode.h>
+#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__)
+#include <compat/linux/linux.h>
+#endif
+
static const char *signames[] = {
[SIGHUP] = "SIGHUP",
[SIGINT] = "SIGINT",
@@ -132,6 +136,78 @@
[SIGRTMIN + 61] = "SIGRT61",
};
+#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__)
+static const char *linux_signames[] = {
+ [LINUX_SIGHUP] = "SIGHUP",
+ [LINUX_SIGINT] = "SIGINT",
+ [LINUX_SIGQUIT] = "SIGQUIT",
+ [LINUX_SIGILL] = "SIGILL",
+ [LINUX_SIGTRAP] = "SIGTRAP",
+ [LINUX_SIGABRT] = "SIGABRT",
+ [LINUX_SIGBUS] = "SIGBUS",
+ [LINUX_SIGFPE] = "SIGFPE",
+ [LINUX_SIGKILL] = "SIGKILL",
+ [LINUX_SIGUSR1] = "SIGUSR1",
+ [LINUX_SIGSEGV] = "SIGSEGV",
+ [LINUX_SIGUSR2] = "SIGUSR2",
+ [LINUX_SIGPIPE] = "SIGPIPE",
+ [LINUX_SIGALRM] = "SIGALRM",
+ [LINUX_SIGTERM] = "SIGTERM",
+ [LINUX_SIGSTKFLT] = "SIGSTKFLT",
+ [LINUX_SIGCHLD] = "SIGCHLD",
+ [LINUX_SIGCONT] = "SIGCONT",
+ [LINUX_SIGSTOP] = "SIGSTOP",
+ [LINUX_SIGTSTP] = "SIGTSTP",
+ [LINUX_SIGTTIN] = "SIGTTIN",
+ [LINUX_SIGTTOU] = "SIGTTOU",
+ [LINUX_SIGURG] = "SIGURG",
+ [LINUX_SIGXCPU] = "SIGXCPU",
+ [LINUX_SIGXFSZ] = "SIGXFSZ",
+ [LINUX_SIGVTALRM] = "SIGVTALRM",
+ [LINUX_SIGPROF] = "SIGPROF",
+ [LINUX_SIGWINCH] = "SIGWINCH",
+ [LINUX_SIGIO] = "SIGIO",
+ [LINUX_SIGPWR] = "SIGPWR",
+ [LINUX_SIGSYS] = "SIGSYS",
+
+ [LINUX_SIGRTMIN] = "SIGRT0",
+ [LINUX_SIGRTMIN + 1] = "SIGRT1",
+ [LINUX_SIGRTMIN + 2] = "SIGRT2",
+ [LINUX_SIGRTMIN + 3] = "SIGRT3",
+ [LINUX_SIGRTMIN + 4] = "SIGRT4",
+ [LINUX_SIGRTMIN + 5] = "SIGRT5",
+ [LINUX_SIGRTMIN + 6] = "SIGRT6",
+ [LINUX_SIGRTMIN + 7] = "SIGRT7",
+ [LINUX_SIGRTMIN + 8] = "SIGRT8",
+ [LINUX_SIGRTMIN + 9] = "SIGRT9",
+ [LINUX_SIGRTMIN + 10] = "SIGRT10",
+ [LINUX_SIGRTMIN + 11] = "SIGRT11",
+ [LINUX_SIGRTMIN + 12] = "SIGRT12",
+ [LINUX_SIGRTMIN + 13] = "SIGRT13",
+ [LINUX_SIGRTMIN + 14] = "SIGRT14",
+ [LINUX_SIGRTMIN + 15] = "SIGRT15",
+ [LINUX_SIGRTMIN + 16] = "SIGRT16",
+ [LINUX_SIGRTMIN + 17] = "SIGRT17",
+ [LINUX_SIGRTMIN + 18] = "SIGRT18",
+ [LINUX_SIGRTMIN + 19] = "SIGRT19",
+ [LINUX_SIGRTMIN + 20] = "SIGRT20",
+ [LINUX_SIGRTMIN + 21] = "SIGRT21",
+ [LINUX_SIGRTMIN + 22] = "SIGRT22",
+ [LINUX_SIGRTMIN + 23] = "SIGRT23",
+ [LINUX_SIGRTMIN + 24] = "SIGRT24",
+ [LINUX_SIGRTMIN + 25] = "SIGRT25",
+ [LINUX_SIGRTMIN + 26] = "SIGRT26",
+ [LINUX_SIGRTMIN + 27] = "SIGRT27",
+ [LINUX_SIGRTMIN + 28] = "SIGRT28",
+ [LINUX_SIGRTMIN + 29] = "SIGRT29",
+ [LINUX_SIGRTMIN + 30] = "SIGRT30",
+ [LINUX_SIGRTMIN + 31] = "SIGRT31",
+ [LINUX_SIGRTMIN + 32] = "SIGRT32",
+};
+_Static_assert(nitems(linux_signames) == LINUX_SIGRTMAX + 1,
+ "invalid entries count in linux_signames");
+#endif /* __amd64__ || __i386__ || __aarch64__ */
+
const char *
sysdecode_signal(int sig)
{
@@ -140,3 +216,14 @@
return (signames[sig]);
return (NULL);
}
+
+#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__)
+const char *
+sysdecode_linux_signal(int sig)
+{
+
+ if ((unsigned)sig < nitems(linux_signames))
+ return (linux_signames[sig]);
+ return (NULL);
+}
+#endif
Index: lib/libsysdecode/sysdecode.h
===================================================================
--- lib/libsysdecode/sysdecode.h
+++ lib/libsysdecode/sysdecode.h
@@ -134,4 +134,8 @@
const char *sysdecode_whence(int _whence);
bool sysdecode_shmflags(FILE *_fp, int _flags, int *_rem);
+#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__)
+const char *sysdecode_linux_signal(int _sig);
+#endif /* __amd64__ || __i386__ || __aarch64__ */
+
#endif /* !__SYSDECODE_H__ */

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 10:04 AM (4 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15731528
Default Alt Text
D35215.id106079.diff (3 KB)

Event Timeline