Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!mycroft From: mycroft@kropotki.gnu.ai.mit.edu (Charles Hannum) Newsgroups: comp.unix.programmer Subject: Re: Non-destructive read of keyboard buffer Message-ID: Date: 8 Jun 91 06:09:01 GMT References: <22368@duke.cs.duke.edu> Sender: news@ai.mit.edu Organization: /home/fsf/mycroft/.organization Lines: 12 In-reply-to: jit@slic.cellbio.duke.edu's message of 7 Jun 91 17:03:28 GMT In article <22368@duke.cs.duke.edu> jit@slic.cellbio.duke.edu writes: Hi, I am trying to find out if a keyboard buffer is empty but not reading it because I don't want to get stuck if there isn't any buffered. (on ATT SVR3) Is there a 'standard' way on unix to do this ? You can use select(2) under BSD, or set the terminal to non-blocking I/O (using the FIONBIO ioctl), try to read, and see if you get EWOULDBLOCK. Details available upon request. B-)