Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uwmcsd1!leah!itsgw!steinmetz!uunet!ateng!chip
From: chip@ateng.uucp (Chip Salzenberg)
Newsgroups: comp.unix.wizards
Subject: Re: How can I read keyboard without stopping
Keywords: curses keyboard
Message-ID: <1988Aug15.130550.8571@ateng.uucp>
Date: 15 Aug 88 17:05:50 GMT
References: <813@ms3.UUCP> <1246@mcgill-vision.UUCP>
Reply-To: chip@ateng.UUCP (Chip Salzenberg)
Organization: A T Engineering, Tampa, FL
Lines: 15

According to mouse@mcgill-vision.UUCP (der Mouse):
>3) FIONREAD.  BSD systems have an ioctl you can apply to a terminal
>   line to get the number of characters queued available for a read().
>   SV may have something similar; I don't know.
>
>   Bad:        - BSD only (as far as I know).

Xenix has the exact equivalent to FIONREAD, but it's not an ioctl() call.
Instead, it's a system call all its own: rdchk(fildes).  Return values are
-1 (not a tty fildes) or >= 0 (number of bytes available).
-- 
Chip Salzenberg                 or 
A T Engineering                My employer may or may not agree with me.
        You make me wanna break the laws of time and space
                    You make me wanna eat pork