From: contact@hacktivis.me
To: musl@lists.openwall.com
Cc: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
Subject: [musl] [PATCH v2 1/3] src/signal/sys_signame.c: create hidden value-name table of signals
Date: Mon, 5 Aug 2024 08:56:05 +0200 [thread overview]
Message-ID: <20240805065607.22897-1-contact@hacktivis.me> (raw)
From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
---
src/include/signal.h | 2 ++
src/signal/sys_signame.c | 41 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
create mode 100644 src/signal/sys_signame.c
diff --git a/src/include/signal.h b/src/include/signal.h
index bb566784..6bbc51d9 100644
--- a/src/include/signal.h
+++ b/src/include/signal.h
@@ -11,4 +11,6 @@ hidden void __restore_sigs(void *);
hidden void __get_handler_set(sigset_t *);
+hidden extern const char __sys_signame[SIGSYS+1][sizeof("STKFLT")];
+
#endif
diff --git a/src/signal/sys_signame.c b/src/signal/sys_signame.c
new file mode 100644
index 00000000..e086572c
--- /dev/null
+++ b/src/signal/sys_signame.c
@@ -0,0 +1,41 @@
+#include <signal.h>
+
+#define SIG(s) [SIG##s] = #s
+const char __sys_signame[SIGSYS+1][sizeof("STKFLT")] = {
+ SIG(HUP),
+ SIG(INT),
+ SIG(QUIT),
+ SIG(ILL),
+ SIG(TRAP),
+ SIG(ABRT),
+ SIG(BUS),
+ SIG(FPE),
+ SIG(KILL),
+ SIG(USR1),
+ SIG(SEGV),
+ SIG(USR2),
+ SIG(PIPE),
+ SIG(ALRM),
+ SIG(TERM),
+#if defined(SIGSTKFLT)
+ SIG(STKFLT),
+#endif
+#if defined(SIGEMT)
+ SIG(EMT),
+#endif
+ SIG(CHLD),
+ SIG(CONT),
+ SIG(STOP),
+ SIG(TSTP),
+ SIG(TTIN),
+ SIG(TTOU),
+ SIG(URG),
+ SIG(XCPU),
+ SIG(XFSZ),
+ SIG(VTALRM),
+ SIG(PROF),
+ SIG(WINCH),
+ SIG(IO),
+ SIG(PWR),
+ SIG(SYS)
+};
--
2.44.2
next reply other threads:[~2024-08-05 6:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 6:56 contact [this message]
2024-08-05 6:56 ` [musl] [PATCH v2 2/3] signal: add sig2str(3) from POSIX.1-2024 contact
2024-08-05 18:12 ` Rich Felker
2024-08-05 6:56 ` [musl] [PATCH v2 3/3] signal: add str2sig(3) " contact
2024-08-05 18:26 ` Rich Felker
2024-08-06 8:21 ` Haelwenn (lanodan) Monnier
2024-08-05 9:13 ` [musl] [PATCH v2 1/3] src/signal/sys_signame.c: create hidden value-name table of signals Joakim Sindholt
2024-08-05 15:29 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240805065607.22897-1-contact@hacktivis.me \
--to=contact@hacktivis.me \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).