about summary refs log tree commit diff
path: root/Src/signals.h
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2024-02-28 00:21:11 +0100
committerOliver Kiddle <opk@zsh.org>2024-02-28 00:21:11 +0100
commit5331ff11c64d9d292f4fe817723af6e0a067fa1f (patch)
tree367ea996dca3e15adc65bc5c4077726f56b08482 /Src/signals.h
parentb68002d927b1577bbed453d7bbbe39b55acf7bd0 (diff)
downloadzsh-5331ff11c64d9d292f4fe817723af6e0a067fa1f.tar.gz
zsh-5331ff11c64d9d292f4fe817723af6e0a067fa1f.tar.xz
zsh-5331ff11c64d9d292f4fe817723af6e0a067fa1f.zip
52594: support for POSIX real-time signals with kill and trap
Also add new -L option to kill for a more verbose listing of signals
Diffstat (limited to 'Src/signals.h')
-rw-r--r--Src/signals.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Src/signals.h b/Src/signals.h
index 41ac88cce..391f11fed 100644
--- a/Src/signals.h
+++ b/Src/signals.h
@@ -36,6 +36,15 @@
 #define SIGZERR   (SIGCOUNT+1)
 #define SIGDEBUG  (SIGCOUNT+2)
 #define VSIGCOUNT (SIGCOUNT+3)
+#if defined(SIGRTMIN) && defined(SIGRTMAX)
+# define TRAPCOUNT (VSIGCOUNT + SIGRTMAX - SIGRTMIN + 1)
+# define SIGNUM(x) ((x) >= VSIGCOUNT ? (x) - VSIGCOUNT + SIGRTMIN : (x))
+# define SIGIDX(x) ((x) >= SIGRTMIN && (x) <= SIGRTMAX ? (x) - SIGRTMIN + VSIGCOUNT : (x))
+#else
+# define TRAPCOUNT VSIGCOUNT
+# define SIGNUM(x) (x)
+# define SIGIDX(x) (x)
+#endif
 #define SIGEXIT    0
 
 #ifdef SV_BSDSIG