www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/10/25/05:26:38

Date: Wed, 25 Oct 1995 10:00:33 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Herbert Kremser <kremser AT sbox DOT tu-graz DOT ac DOT at>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: need something better than kbhit()

On 25 Oct 1995, Herbert Kremser wrote:

> How can you determine if something is available at stdin?
> I rather need a nonblocking input function.
> 
> kbhit() doesn't work, since it checks the real keyboard, not the
> (buffered) stdin descriptor.

DJGPP v2.0 implements select() which might be what you want.  It uses an 
IOCTL call (Int 21h/AX=4406h) to check whether input is available, and
augments this by looking at the buffer of the FILE structure.  If you 
need this for DJGPP v1.12, you will have to change it a bit (because the 
FILE structure is a bit different); in v2.0, just use select().

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019