This is the mail archive of the
cygwin@cygwin.com
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
- Bcc:
Hi all,
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.
ie:
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:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12722
I'm wondering
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
Regards
Arash
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.
http://www.partow.net
.
_________________________________________________________________
Get less junk mail with ninemsn Premium. Click here
http://ninemsn.com.au/premium/landing.asp
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/