bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] sig2str: list all signals on FreeBSD >= 7


From: Pádraig Brady
Subject: [PATCH] sig2str: list all signals on FreeBSD >= 7
Date: Thu, 14 Jan 2016 09:53:23 +0000

FreeBSD >= 7 is contravening POSIX by not defining NSIG
to the maximal statically defined signal value.
It does define _SIG_MAXSIG though, so base SIGNUM_BOUND on that.

* lib/sig2str.h (SIGNUM_BOUND): Define to (_SIG_MAXSIG - 2)
where available, even when NSIG is defined.
---
 ChangeLog     | 9 +++++++++
 lib/sig2str.h | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 858615a..b19edb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-01-14  P??draig Brady  <address@hidden>
+
+       sig2str: list all signals on FreeBSD >= 7
+       FreeBSD >= 7 is contravening POSIX by not defining NSIG
+       to the maximal statically defined signal value.
+       It does define _SIG_MAXSIG though, so base SIGNUM_BOUND on that.
+       * lib/sig2str.h (SIGNUM_BOUND): Define to (_SIG_MAXSIG - 2)
+       where available, even when NSIG is defined.
+
 2016-01-13  Paul Eggert  <address@hidden>
 
        acl-permissions: port to USE_ACL==0 platforms
diff --git a/lib/sig2str.h b/lib/sig2str.h
index f347170..2730774 100644
--- a/lib/sig2str.h
+++ b/lib/sig2str.h
@@ -44,6 +44,8 @@ int str2sig (char const *, int *);
 
 #if defined _sys_nsig
 # define SIGNUM_BOUND (_sys_nsig - 1)
+#elif defined _SIG_MAXSIG
+# define SIGNUM_BOUND (_SIG_MAXSIG - 2) /* FreeBSD >= 7.  */
 #elif defined NSIG
 # define SIGNUM_BOUND (NSIG - 1)
 #else
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]