Repost - Serial Port Question

Sorry, I posted in comp.os.qnx by mistake. Hope someone here has some
insight :slight_smile:

I have a QNX 4 machine with a serial port configured in raw mode with the
following settings:

stty baud=9600 +raw -ohpaged -ohflow -lkhflow -osflow par=odd < /dev/ser1.

My application opens the port in blocking mode (no O_NBLOCK flag set). I
use a select call to tell me when there is data available for reading. This
all appears to work fine.

However occasionally my application will become blocked on Dev32. I suspect
that perhaps it is my write that is blocking because I have no timeouts
there.

Can someone tell me under what circumstances my write might block forever?
Will this happen if the UART transmit fifo becomes full and the application
on the other side is not reading any data from the port? (i.e serial cable
unplugged)

Assuming this is the case, what is the best way to resolve it? Should I use
select on the write side as well? I would like my application to be able to
recover
from failures such as unplugged cables and continue writing once the cable
is back.

Thanks for any insight you can provide.