From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22360 invoked from network); 31 Oct 2000 15:27:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Oct 2000 15:27:27 -0000 Received: (qmail 5253 invoked by alias); 31 Oct 2000 15:27:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13104 Received: (qmail 5246 invoked from network); 31 Oct 2000 15:27:19 -0000 From: "Bart Schaefer" Message-Id: <1001031152552.ZM18160@candle.brasslantern.com> Date: Tue, 31 Oct 2000 15:25:52 +0000 In-Reply-To: <0G3A00G16RTYPP@la-la.cambridgesiliconradio.com> Comments: In reply to Peter Stephenson "Re: zsh-3.1.9-dev-6 crashes occassionally" (Oct 31, 1:51pm) References: <0G3A00G16RTYPP@la-la.cambridgesiliconradio.com> <200010311401.PAA00843@beta.informatik.hu-berlin.de> In-Reply-To: <200010311401.PAA00843@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: zsh-3.1.9-dev-6 crashes occassionally" (Oct 31, 3:01pm) X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: zsh-3.1.9-dev-6 crashes occassionally MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 31, 1:51pm, Peter Stephenson wrote: } Subject: Re: zsh-3.1.9-dev-6 crashes occassionally } } Sven wrote: } > + ALLOWTRAPS { } > + while ((r = read(SHTTY, &cc, 1)) != 1) { } } I suppose you've thought this through more than I have, but wouldn't it be } safer just to run traps every time the read returns? I'm assuming a signal } arriving will interrupt the read in any case, so as far as I can see it's } pretty much equivalent in practise. On Oct 31, 3:01pm, Sven Wischnowsky wrote: } } Unless someone knows of a system where signals don't interrupt things } like read. Ever heard of BSD restartable system calls? Signals don't always interrupt things like read. On systems that have the sigaction() interface, you can choose to turn restartable-ness on and off, but on an older BSD system the only way out of a system call from a signal handler is with setjmp/longjmp. That's what I was talking about before in my last message. (I haven't used a modern openbsd/freebsd system, so it may not be an issue there any longer.) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net