Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Originating-IP: [203.94.167.77] X-Originating-Email: [arashp AT hotmail DOT com] X-Sender: arashp AT hotmail DOT com From: "Arash Partow" To: cygwin AT cygwin DOT com Subject: problem comport, iocl and FIONREAD Date: Wed, 31 Dec 2003 00:16:54 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 31 Dec 2003 00:16:54.0277 (UTC) FILETIME=[6516A350:01C3CF33] X-IsSubscribed: yes 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/