Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: add -q option to kill for sigqueue
- X-seq: zsh-workers 52372
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: add -q option to kill for sigqueue
- Date: Mon, 04 Dec 2023 22:58:40 +0100
- Archived-at: <https://zsh.org/workers/52372>
- In-reply-to: <74520-1700869567.390063@twie.42H7.9hr2>
- List-id: <zsh-workers.zsh.org>
- References: <74520-1700869567.390063@twie.42H7.9hr2>
On 25 Nov, I wrote:
> The following adds support for a -q option to kill which takes a numeric
> argument. It then uses sigqueue(2) to send the signal with the provided
And with the following addition, the documentation and completion also
cover the option. Seems it isn't a system call on Linux so the man page
there is sigqueue(3).
Oliver
diff --git a/Completion/Zsh/Command/_kill b/Completion/Zsh/Command/_kill
index b9dfde3f0..084cf42c8 100644
--- a/Completion/Zsh/Command/_kill
+++ b/Completion/Zsh/Command/_kill
@@ -5,6 +5,7 @@ typeset -A opt_args
_arguments -C \
'(-s -l 1)-n[specify signal number]:signal number' \
+ '(-l)-q[send the specified integer with the signal using sigqueue]:value' \
'(-n -l 1)-s[specify signal name]:signal:_signals -s' \
'(-n -s)-l[list signal names or numbers of specified signals]:*:signal:_signals' \
'(-n -s -l)1::signal:_signals -p -s' \
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 8f310f6cf..81694225d 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1142,7 +1142,7 @@ findex(kill)
cindex(killing jobs)
cindex(jobs, killing)
xitem(tt(kill) [ tt(-s) var(signal_name) | tt(-n) var(signal_number) | \
-tt(-)var(sig) ] var(job) ...)
+tt(-)var(sig) ] [ tt(-q) var(value) ] var(job) ...)
item(tt(kill) tt(-l) [ var(sig) ... ])(
Sends either tt(SIGTERM) or the specified signal to the given
jobs or processes.
@@ -1169,6 +1169,9 @@ tt(kill -IO) and tt(kill -POLL) have the same effect.
Many systems will allow process IDs to be negative to kill a process
group or zero to kill the current process group.
+
+The tt(-q) option allows an integer value to be sent with the signal
+on systems that support tt(sigqueue+LPAR()RPAR()).
)
findex(let)
item(tt(let) var(arg) ...)(
Messages sorted by:
Reverse Date,
Date,
Thread,
Author