From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 852 invoked from network); 4 Dec 2023 21:58:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Dec 2023 21:58:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=7j4IgO+pEp6bVH6Ywl58RsvAAiZ8ISAkaXUI+///vwM=; b=iEI/vO6L+GIebBXSUaVNA4A2HG gX/j30h6MueAji1TWo5c2HIDwx0F58QSi+9kdQOkN7E9D1oA3GbFh0yyI8CFLf9Hx04RV2K0CDYqU 4kYV4yvCStxf6+dKb+1OohVVEdndntNfdQmqrDwobXhbyu03puhm5j8G+Qg32WW1H+vTdvE+qp6zI F/PrGf2Xzv94/SKG7lI7hr9PONpW4jWv9NF1V125nMvxrjHLmXNnPSuUDW7mmEV+DHissqDGswvvZ QKyZNJwTd04pm0Qa6ND06t0ECx8dR/EwCdHhpEuiucocL2NVe7/JS3jEDwO2x7sFB5ci2Y/kVXMDY mKcNSQKw==; Received: by zero.zsh.org with local id 1rAGxs-0007D4-RH; Mon, 04 Dec 2023 21:58:56 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rAGxe-0006vE-8E; Mon, 04 Dec 2023 21:58:42 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.95) (envelope-from ) id 1rAGxc-000MZ6-Uw for zsh-workers@zsh.org; Mon, 04 Dec 2023 22:58:41 +0100 In-reply-to: <74520-1700869567.390063@twie.42H7.9hr2> From: Oliver Kiddle References: <74520-1700869567.390063@twie.42H7.9hr2> To: Zsh workers Subject: Re: PATCH: add -q option to kill for sigqueue MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <86742.1701727120.1@hydra> Date: Mon, 04 Dec 2023 22:58:40 +0100 Message-ID: <86743-1701727120.927049@MNwc.Gsx3.5nJi> X-Seq: 52372 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: 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) ...)(