diff options
author | Mattias Andrée <maandree@kth.se> | 2020-06-21 10:18:51 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-06-21 10:18:51 +0200 |
commit | 2be02f9634aa7da0a75bd0e030ec5467ad8ad6fd (patch) | |
tree | d0ad10f568f3d0d544dec0fe801fbb0f76a69370 | |
parent | Use literal tab inside [] in sed scripts (diff) | |
download | sctrace-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>
Diffstat (limited to '')
-rw-r--r-- | consts.c | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -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; } |