This is the mail archive of the
mailing list for the Cygwin project.
problem comport, iocl and FIONREAD
- From: "Arash Partow" <arashp at hotmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 31 Dec 2003 00:16:54 +0000
- Subject: problem comport, iocl and FIONREAD
I'm seeing a problem with ioctl and FIONREAD, I use the
following code to check if there are any bytes in the
input buffer of a comport.
unsigned int SerialIO::getBufferSize()
int bufferedBytes = 0;
ioctl(IOPortHandle, FIONREAD, &bufferedBytes);
if (bufferedBytes == -1)
bufferedBytes = 0;
/* log an error */
return (unsigned int)bufferedBytes;
the problem is that even when there is data in the buffer
bufferedBytes has a value of zero.
Searching the net I've found an unresolved gcc bug report
on the same problem issued 2 months ago:
1. If any cygwin users have encountered such a problem?
2. If they have, were they able to find a solution etc..
Any help would be very much appreciated
PS: I ran the same code on solaris and openbsd, seems
to work fine...
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
Get less junk mail with ninemsn Premium. Click here
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html