From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1927 invoked from network); 22 Feb 2003 22:51:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 22 Feb 2003 22:51:04 -0000 Received: (qmail 23270 invoked by alias); 22 Feb 2003 22:50:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18274 Received: (qmail 23254 invoked from network); 22 Feb 2003 22:50:31 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 22 Feb 2003 22:50:31 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.233.231] by sunsite.dk (MessageWall 1.0.8) with SMTP; 22 Feb 2003 22:50:30 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h1MNoHB10750 for zsh-workers@sunsite.dk; Sat, 22 Feb 2003 15:50:17 -0800 From: "Bart Schaefer" Message-Id: <1030222235017.ZM10749@candle.brasslantern.com> Date: Sat, 22 Feb 2003 23:50:16 +0000 In-Reply-To: <24638.1045249035@csr.com> Comments: In reply to Peter Stephenson "PATCH: Poll tty before selecting on Solaris" (Feb 14, 6:57pm) References: <24638.1045249035@csr.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: Poll tty before selecting on Solaris MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 14, 6:57pm, Peter Stephenson wrote: } } This extravaganza is necessary on Solaris when you use select() with the } terminal and there is already typeahead --- it doesn't see it, you need } to use a read with the termios poll mechanism. It's been quite a while since I worked with Solaris, but I suspect this has to do with the STREAMS-based tty driver. Typeahead that has already been buffered by the stream object is invisible to select(). There might be a tty mode setting to make the input stream unbuffered that would avoid the need to poll(). Note this isn't related to stdio buffers, so setbuf() et al. probably isn't going to have any effect on it.