Blocking behaviour of serial ports

Curl Jason-A15595 J.Curl@motorola.com
Tue Aug 9 19:45:00 GMT 2005


Hello,

I've attached a small program that exhibits the behaviour, running Cygwin 1.5.18-1.

I use the select() function call to determine if it is allowed to write() to a serial port. select() indicates it is allowed, and the next write blocks. The serial port has hardware handshake control enabled (RTS/CTS), and it is unblocked as soon as CTS moves to the correct state.

Is this a problem with how I've configured serial ports? I've spent a lot of time on the 'Net today and don't find anything related to this specific problem, tested it on Linux FC4 and I have the behaviour I would have expected.

To compile:
$ gcc -Wall wblock.c -owblock
$ ./wblock

Then to test I used a normal 9-pin serial cable (one that might be used to connect to a modem, or another CE device, NOT null-modem). I used a pair of scissors to just short pins 8-4 (drive CTS -ve so it writes) or 8-3 (or not at all is equivalent, drive CTS +ve so the TX line is inactive). I had an RS232 analyser (bunch of LEDs attached to the serial port) to see what was happening.

Thanks,
Jason.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wblock.c
Type: application/octet-stream
Size: 2313 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050809/0b8cdf85/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 30045 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050809/0b8cdf85/attachment-0001.obj>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list