From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id da9c54c0 for ; Mon, 29 Jul 2019 22:26:15 +0000 (UTC) Received: (qmail 25588 invoked by alias); 29 Jul 2019 22:26:07 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44585 Received: (qmail 9957 invoked by uid 1010); 29 Jul 2019 22:26:07 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f195.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(209.85.208.195):SA:0(-1.9/5.0):. Processed in 3.885529 secs); 29 Jul 2019 22:26:07 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.208.195 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aIebCZ85P0CGGRmZeekR8ukeJXDZ+ENWP0215tDZInE=; b=igaAP3ZSKli2BhAJOHw/roTizGjH/v9xEu5fHn2kg+lWjxnCqRoa0ZNFoNeCxeWePy Q6ek9YmC1U9mzboVzxDHVUqmVAiW2V2taEZMSZhfsnrCS7dSh17Z2kY4WsU8zumyd/Mb jPy7BQCcz3Dw20amnmT4RTQukKcuiYtd2/4VR1+q0srYjdfNLph5/RYP7ldE5DjpUUUk lL+ivOnx8eaHzNaaRa2pOZBRnQsk5kofD0nf1/2gvfxgC39RNdnZ7cYDO3KjrtpZZ+jE UmcRp6nWwTQo6ZVOvSqig3rFx9RhL6C3XZ9WrD3B677+vLd1xVZoDn/Y4hHwN07PAG0B 5G+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aIebCZ85P0CGGRmZeekR8ukeJXDZ+ENWP0215tDZInE=; b=DxDKuXHJ6zBmPlOsKG+qj9ZciIxvyAyaaZP06MfRnX/01Z3YWhxeLPnLIZ+gPDpYoY 7Y/o0p+FdTqxojAlnQmz96LlckNqMRQ2wilNeriFqdGWn3JHBCHDN7uCNrZNqU9H4sG/ kEb8MagHFCDcfH51Zl9+QgL0KIpjLKhwXFUmunGlrkBPomne+831aI+IXFZehz/Bm1aK hpuYeApmDtSkFdXMrGgYG5ksxPLA5N8V0+fYCgVAB7ZdDZmLvAjq8/VIvSbSh6c17z0z tXzb3zRZHzZFSMUZhLwdtwxCgQ0OUU0XHceww9XkJfL/ccpHO/wFz3V/5mRqNE4ptC7X Q4ww== X-Gm-Message-State: APjAAAV1JIX5c6Dn0Qwn2H1y2p3Z9t/FW87zdIt93uyLQmWj23RHNV4t x/3hNiSp8wItVvMMyGWAbtgZfvl66VU0tJckvDUDtA== X-Google-Smtp-Source: APXvYqxwich7WaL/x7ka8pAD5QPajNXp3Og6qanUSy94lQmuY9QhEk6TsDhhRQoxvkDgldt/Q9jIzTVgnUsFkgjK8CY= X-Received: by 2002:a05:651c:1b8:: with SMTP id c24mr61291677ljn.2.1564439129052; Mon, 29 Jul 2019 15:25:29 -0700 (PDT) MIME-Version: 1.0 References: <20190729203521.upp5ku3bsr3hsnxq@phare.normalesup.org> In-Reply-To: <20190729203521.upp5ku3bsr3hsnxq@phare.normalesup.org> From: Bart Schaefer Date: Mon, 29 Jul 2019 15:25:17 -0700 Message-ID: Subject: Re: [PATCH] Enable sub-second timeout in zsystem flock To: Cedric Ware Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" On Mon, Jul 29, 2019 at 1:36 PM Cedric Ware wrote: > > The attached patch (against zsh 5.7.1) modifies the bin_zsystem_flock() In future, please either inline patches or attach them as text/plain (e.g. with a ".txt" extension instead of ".patch"). Thanks! > I kept the same function's logic of periodically retrying to acquire > the lock in non-blocking mode. However, there may be a better way to > implement this timeout: set a timer such as setitimer(2) which sends > a SIGALRM on timeout Unfortunately that technique can't be used because ALRM is a signal that the user is allowed to trap via the "trap" command or TRAPALRM function, and which is controlled by the TMOUT variable which is also user settable.