Initial commit

This commit is contained in:
2026-01-10 02:18:04 -08:00
commit 79e610fa09
7 changed files with 1006 additions and 0 deletions

28
gen-signal-names.awk Normal file
View File

@ -0,0 +1,28 @@
BEGIN {
cmd = "printf '#include <signal.h>\n' | " COMPILER " -E -dM -x c - | sort -nk 3"
FS=" "
print "#include <signal.h>"
print ""
print "static const char *SIGNAL_NAMES[] = {"
min = 0
max = 0
while ((cmd | getline record)) {
if (record ~ /^#define\s*SIG[A-Z0-9]+\s*[0-9]+$/) {
split(record, fields, /\s+/)
name = fields[2]
number = fields[3]
if (name != "SIGSTKSZ") {
print " [" name "] = \"" name "\","
if (min == 0) {
min = number
}
if (number > max) {
max = number
}
}
}
}
print "};"
print "#define MIN_SIGNUM " min
print "#define MAX_SIGNUM " max
}