From 2be02f9634aa7da0a75bd0e030ec5467ad8ad6fd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 21 Jun 2020 10:18:51 +0200 Subject: Use __SIGRTMIN and __SIGRTMAX and #define them if missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- consts.c | 27 ++++++++++++++++++++------- 1 file 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; } -- cgit v1.2.3-70-g09d2