aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-06-21 10:18:51 +0200
committerMattias Andrée <maandree@kth.se>2020-06-21 10:18:51 +0200
commit2be02f9634aa7da0a75bd0e030ec5467ad8ad6fd (patch)
treed0ad10f568f3d0d544dec0fe801fbb0f76a69370
parentUse literal tab inside [] in sed scripts (diff)
downloadsctrace-2be02f9634aa7da0a75bd0e030ec5467ad8ad6fd.tar.gz
sctrace-2be02f9634aa7da0a75bd0e030ec5467ad8ad6fd.tar.bz2
sctrace-2be02f9634aa7da0a75bd0e030ec5467ad8ad6fd.tar.xz
Use __SIGRTMIN and __SIGRTMAX and #define them if missing
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--consts.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/consts.c b/consts.c
index 2484ced..d1c3af1 100644
--- a/consts.c
+++ b/consts.c
@@ -2,6 +2,19 @@
#include "common.h"
+#ifndef __SIGRTMIN
+# ifdef __linux__
+# define __SIGRTMIN 32
+# endif
+#endif
+
+#ifndef __SIGRTMAX
+# ifdef __linux__
+# define __SIGRTMAX (_NSIG - 1)
+# endif
+#endif
+
+
const char *
get_errno_name(int err)
{
@@ -40,17 +53,17 @@ get_signum_name(int sig)
LIST_SIGNUMS(X)
#undef X
- if (SIGRTMIN <= sig && sig <= SIGRTMAX) {
- above_low = sig - SIGRTMIN;
- below_high = SIGRTMAX - sig;
+ if (__SIGRTMIN <= sig && sig <= __SIGRTMAX) {
+ above_low = sig - __SIGRTMIN;
+ below_high = __SIGRTMAX - sig;
if (!above_low)
- return "SIGRTMIN";
+ return "__SIGRTMIN";
if (!below_high)
- return "SIGRTMAX";
+ return "__SIGRTMAX";
if (above_low <= below_high)
- sprintf(buf, "SIGRTMIN+%i", above_low);
+ sprintf(buf, "__SIGRTMIN+%i", above_low);
else
- sprintf(buf, "SIGRTMAX-%i", below_high);
+ sprintf(buf, "__SIGRTMAX-%i", below_high);
return buf;
}