Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!mirror!necntc!necis!rbono From: rbono@necis.UUCP (Rich Bono) Newsgroups: comp.lang.c Subject: input ready under UNIX ??!!?? Keywords: input, unix, help Message-ID: <771@necis.UUCP> Date: 21 Oct 88 13:24:02 GMT Organization: NEC Information Systems, Acton, MA Lines: 37 HELP!! how can one (if at all) find out (non-destructivly) if there is any input waiting to be read from stdin??? With the Microsoft-C libraries I can use the kbhit() function which returns TRUE if there are any characters waiting to be input. Clearing ICANON with a ioctl() for stdin does NOT do what I want..... here is a sample code concept that shows what I am trying to do: for(;;) { if(kbhit()) { fgets(buffer, BUFSIZE, stdin); HandleInput(buffer); } else { /* do this */ } } I have several programs that make use of this call that I would like to port to UNIX without redesigning. Please EMAIL me with any soloutions..... Thanks, Rich -- #****************************************************************************# # Rich Bono (NM1D) domain: rbono@necis.nec.com # # (508) 635-6303 # #****************************************************************************#