This is the mail archive of the cygwin-developers@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Serial blocking read


Has anyone else had problems with serial port reads blocking even when
O_NONBLOCK is passed to _read in the 1.1.6-1 DLL?

I noticed that my reads were appropriately non-blocking most of the time, but
blocked whenever "overlapped_armed" was set, because in this case raw_read
never finds out how many bytes are in the serial port's buffer.  This patch
seems to fix the problem for me :

121a122,128
>       if (overlapped_armed) {
>           if (!ClearCommError (get_handle (), &ev, &st))
> 	          goto err;
>           else if (st.cbInQue)
>             inq = st.cbInQue;
>       }
> 

If anyone else has found a better solution to this problem, let me know...
otherwise perhaps this patch will fix things.

-Dan
 
Dan Morris
http://techhouse.brown.edu/dmorris

Tiqit Computers
http://www.tiqit.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]