This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: GNUWIN32 Question
- To: Sergey Okhapkin <sos at prospect dot com dot ru>
- Subject: Re: GNUWIN32 Question
- From: "$Bill Luebkert" <dbe at wgn dot net>
- Date: Wed, 11 Jun 1997 18:06:23 -0700
- CC: "gnu-win32 at cygnus dot com" <gnu-win32 at cygnus dot com>, "'Robert'" <macaul at vvm dot com>
- Organization: DBE Collectibles
- References: <01BC764E.5C314230@gater.krystalbank.msk.ru>
- Reply-To: dbe at wgn dot net
Sergey Okhapkin wrote:
>
> Robert wrote:
> > <<File: ATT00000.att>>
> > I love your product, I just need one thing. A kbhit() function. The
Don't want to step on any toes here, but there are a couple of syntactic
errors in this code fragment (marked below). Haven't tried the code,
so I can't say anything about the logic (which looks ok). :)
> #include <sys/socket.h>
> #include <sys/time.h>
>
> int kbhit()
> {
> FD_SET rfds;
Should be lowercase:
fd_set rfds;
> struct timeval tv;
>
> FD_ZERO(&rfds);
> FD_SET(0, &rfds);
> tv.tv_sec = 0;
> tv.tv_usec = 0;
> select(1, &rfds, 0, 0, &tv);
Could check for error return here, but not too likely.
> return(FD_ISSET(0, &rfds);
Leave off the first paren:
return FD_ISSET(0, &rfds);
> }
Just in case robert isn't an experienced programmer. :)
--
,-/- __ _ _ $Bill Luebkert
(_/ / ) // // DBE Collectibles
/ ) /--< o // // http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_ Email: dbe@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".