problem comport, iocl and FIONREAD

2003-12-30 Thread Arash Partow
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)

Re: problem comport, iocl and FIONREAD

2003-12-30 Thread Brian Dessent
Arash Partow wrote: > > 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: Check the return value of ioctl(), I bet it's returning error and setting EINVAL. I think you want TIOCINQ inste