From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23847 invoked by alias); 20 Aug 2002 18:20:26 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 23838 invoked from network); 20 Aug 2002 18:20:25 -0000 Received: from unknown (HELO wh2-19.st.uni-magdeburg.de) (141.44.162.19) by sources.redhat.com with SMTP; 20 Aug 2002 18:20:25 -0000 Received: by wh2-19.st.uni-magdeburg.de (Postfix, from userid 1000) id A6B2D90F60; Tue, 20 Aug 2002 20:19:14 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15714.34848.442304.695492@wh2-19.st.uni-magdeburg.de> Date: Tue, 20 Aug 2002 11:20:00 -0000 From: "Claudio Bley" To: Ish Rattan Cc: Subject: Re: Unbuffered line input and the GNU library In-Reply-To: References: X-SW-Source: 2002-08/txt/msg00182.txt.bz2 >>>>> "Ish" == Ish Rattan writes: Ish> On Mon, 19 Aug 2002, Steve Dondley wrote: >> function. However, I did a grep on every *.h file on my >> computer and wasn't Ish> It is a macro defined in /usr/include/stdio.h I can't find it there (glibc 2.2.5 Debian GNU/Linux). What's the version of your C library that you're using? Usually, in order to get unbuffered line input you need to switch the terminal to unbufferd input mode (and properly restore it when done - I guess this wouldn't work with a simple macro; I'd really like to see the macro if it really is there). Here's some code I used for this purpose: ,---- | struct termios tio_orig; | struct termios tio_new; | | tcgetattr(0, &tio_orig); | | tio_new = tio_orig; | tio_new.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */ | tcsetattr(0,TCSANOW,&tio_new); | | /* ... */ | | tcsetattr(0,TCSANOW,&tio_orig); `---- Cheers. -- Claudio Bley _ ASCII ribbon campaign ( ) ICQ# 83197241 - against HTML email X http://www.cs.uni-magdeburg.de/~bley/ & vCards / \