musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/string/strsignal.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013年07月09日 02:23:16 -0400
committerRich Felker <dalias@aerifal.cx>2013年07月09日 02:23:16 -0400
commitc90fa2ace73851d6af4946c239c90db91cad8abe (patch)
tree50322e9ed08e351a6ae31cd55af1d305e2615ad8 /src/string/strsignal.c
parent8599822ee1d70a1e42e1d4b4962bc1d0bdf7e5ab (diff)
downloadmusl-c90fa2ace73851d6af4946c239c90db91cad8abe.tar.gz
add realtime signals to strsignal
the name format RTnn/RTnnn was chosen to minimized bloat while uniquely identifying the signal.
Diffstat (limited to 'src/string/strsignal.c')
-rw-r--r--src/string/strsignal.c 22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/string/strsignal.c b/src/string/strsignal.c
index d70982aa..f0c3db7a 100644
--- a/src/string/strsignal.c
+++ b/src/string/strsignal.c
@@ -48,7 +48,7 @@ static const char map[] = {
[SIGSYS] = 31
};
-#define sigmap(x) ((unsigned)(x) >= sizeof map ? 0 : map[(unsigned)(x)])
+#define sigmap(x) ((x) >= sizeof map ? (x) : map[(x)])
#endif
@@ -84,14 +84,30 @@ static const char strings[] =
"Window changed0円"
"I/O possible0円"
"Power failure0円"
- "Bad system call";
+ "Bad system call0円"
+ "RT32"
+ "0円RT330円RT340円RT350円RT360円RT370円RT380円RT390円RT40"
+ "0円RT410円RT420円RT430円RT440円RT450円RT460円RT470円RT48"
+ "0円RT490円RT500円RT510円RT520円RT530円RT540円RT550円RT56"
+ "0円RT570円RT580円RT590円RT600円RT610円RT620円RT630円RT64"
+#if _NSIG > 65
+ "0円RT650円RT660円RT670円RT680円RT690円RT700円RT710円RT72"
+ "0円RT730円RT740円RT750円RT760円RT770円RT780円RT790円RT80"
+ "0円RT810円RT820円RT830円RT840円RT850円RT860円RT870円RT88"
+ "0円RT890円RT900円RT910円RT920円RT930円RT940円RT950円RT96"
+ "0円RT970円RT980円RT990円RT1000円RT1010円RT1020円RT1030円RT104"
+ "0円RT1050円RT1060円RT1070円RT1080円RT1090円RT1100円RT1110円RT112"
+ "0円RT1130円RT1140円RT1150円RT1160円RT1170円RT1180円RT1190円RT120"
+ "0円RT1210円RT1220円RT1230円RT1240円RT1250円RT1260円RT1270円RT128"
+#endif
+ "";
char *strsignal(int signum)
{
char *s = (char *)strings;
signum = sigmap(signum);
- if ((unsigned)signum - 1 > 31) signum = 0;
+ if (signum - 1U >= _NSIG-1) signum = 0;
for (; signum--; s++) for (; *s; s++);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月09日 20:49:30 +0000

AltStyle によって変換されたページ (->オリジナル) /