From 00c9a6188bb457989e4cd842e7317c14df6d9a7a Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 19 Oct 2018 03:33:48 +0000 Subject: vm_core.h: NSIG is a BSDism. Surprisingly, this constant (been there since around 1983) has never been a part of any standards until now. We have to find out the appropriate value. NSIG_MAX is expected to become a part of forthcoming POSIX. See: http://austingroupbugs.net/view.php?id=741 _SIG_MAXSIG is here because that is greater than NSIG. See Python's relevant discussion: https://bugs.python.org/issue20584 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index 78de294b07..9716aff3fc 100644 --- a/vm_core.h +++ b/vm_core.h @@ -86,8 +86,18 @@ #include #include -#ifndef NSIG -# define NSIG (_SIGMAX + 1) /* For QNX */ +#if defined(NSIG_MAX) /* POSIX issue 8 */ +# undef NSIG +# define NSIG NSIG_MAX +#elif defined(_SIG_MAXSIG) /* FreeBSD */ +# undef NSIG +# define NSIG _SIG_MAXSIG +#elif defined(_SIGMAX) /* QNX */ +# define NSIG (_SIGMAX + 1) +#elif defined(NSIG) /* 99% of everything else */ +# /* take it */ +#else /* Last resort */ +# define NSIG (sizeof(sigset_t) * CHAR_BIT + 1) #endif #define RUBY_NSIG NSIG -- cgit v1.2.3