serial port read failure

John E. A.
Mon Dec 30 15:04:00 GMT 2002

Hi There,

I've been compiling a simple application in both linux and cygwin. I hacked it 
from a GNU readline library application example: fileman.c

I added serial port device access (/dev/ttyS0) to this program via both stream 
i/o (fopen, putc, etc) and low level i/o (open, read, etc) both versions work 
when compiled under linux, neither work when compiled under cygwin.

I've stepped through my code using gdb --nw and find that the failures usually 
occur in the fgetc and read functions.

Sometimes I can single-step through these functions with success, but they never 
run successfully, at full speed, in cygwin.

I have a new full net install of cygwin: 1.3.17 including source, running on 
win2k pro.

Can someone please provide some simple working example of serial port device access?

Additionally I am not able to step into the newlib source. Any tips on getting 
gdb to step into the library function source would also be greatly appreciated. 
For example, If I'm on a source line of:
143	data = fgetc(port);
and enter a gdb command of:
(gdb) s
my last printf data is flushed from the output buffer (it didn't end in \n) and 
then it just hangs. When I C-c I get:
Program received signal SIGINT, Interrupt.
[Switching to thread 900.0x3f4]
0x77ec7fb0 in _libkernel32_a_iname ()
(gdb) Quit
(gdb) _
and I'm back at the gdb prompt.

Thank You for your reply...

John E. A.

Unsubscribe info:
Bug reporting:

More information about the Cygwin mailing list