From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24972 invoked by alias); 3 Sep 2013 03:05:43 -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: X-Seq: 31688 Received: (qmail 35 invoked from network); 3 Sep 2013 03:05:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=tTEva6t4wRANG5Af7g7S0exbyQII7IYtMYQvrkmBz20=; b=ft4/3nrAWawxkE5WcXrkUj5vpPrUQkzP9dnPthYqstXroppB1R+pKCIks5/Cw81ZjOK0GCxmvLUSepsGo21PzL9kqgSdNr+2I8Wl0quNkXqDYt/j/RdVi+0rfgo05hCy2sipBPU8Xvw8P7O9RcuKW6ee9vw6SIIf8psD/7zb0zw=; Date: Mon, 2 Sep 2013 20:05:27 -0700 From: Phil Pennock To: Bart Schaefer Cc: zsh-workers@zsh.org Subject: Re: sleep $floatval Message-ID: <20130903030527.GA33633@redoubt.spodhuis.org> Mail-Followup-To: Bart Schaefer , zsh-workers@zsh.org References: <20130831234733.GA83723@redoubt.spodhuis.org> <20130901182926.2ad24eb4@pws-pc.ntlworld.com> <20130902023340.GA14105@redoubt.spodhuis.org> <130902110905.ZM26303@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <130902110905.ZM26303@torch.brasslantern.com> On 2013-09-02 at 11:09 -0700, Bart Schaefer wrote: > Hmm, sleep is a library call, not a system call, and isn't documented as > setting errno to anything useful, so you must be planning on implementing > the delay some other way? nanosleep being less portable than select, I was tending towards the second. (I wish I were clever enough to have come up with that pun deliberately). > What happens if a handler invokes zsleep again with a different list of > functions? Also, how do you plan to keep track of whether the original > sleep time has expired while the handlers were executing? Track desired end time, get current time before re-entering, only request long enough for the remaining delta. > Other problems of having a builtin sleep include defining the interaction > with signal handlers, particularly the ALRM handler. Another good reason to just use select(2) instead of sleep(3). :) -Phil