np43 / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

Bug in POSIX implementation of function flush() #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
WINDOWS implementation of the function flush() uses function
FlushFileBuffers(Win_Handle). The FlushFileBuffers() function writes all
the buffered information for a specified file to the device or pipe. It is
correct.
POSIX implementation of the function flush() uses function tcflush(fd,
TCIOFLUSH). Upon successful completion, tcflush() DISCARDS (!!!) data
written to the object referred to by fildes (an open file descriptor
associated with a terminal) but not transmitted, or data received but not
read, depending on the value of queue_selector. It is wrong!!!
It is necessary to use tcdrain() function instead.

Original issue reported on code.google.com by Dmitri.F...@gmail.com on 20 May 2010 at 9:49

GoogleCodeExporter commented 9 years ago
I had a flush() problem with MAC OS X, I substituted tcflush() with tcdrain() 
and now flush() works!

Thanks Dmitri!

Original comment by michele....@gmail.com on 23 Nov 2010 at 5:09

GoogleCodeExporter commented 9 years ago
Yes, this bug gave me a headache too!

Original comment by dirkc...@gmail.com on 26 Sep 2011 at 7:22

GoogleCodeExporter commented 9 years ago
Thanks

Original comment by dbzhang...@gmail.com on 16 Mar 2012 at 8:29