This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


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

Re: device open close flow-control


On Mon, 8 May 2000, Roland Schwarz wrote:

> Now I want to 'close' the device on the sending side.
> 
> But the close function does not return until the receiver
> has released his flow control. That is bad.
> 
> What can I do about this? I want anyhow to force the
> connection closed.

This isn't a glibc problem or issue. It's a kernel issue.  Read the source code
for the n_tty line discipline and the rs_serial.c driver. I think that if you
put the device into non-blocking mode (or open it with O_NONBLOCK) you can do a
close which doesn't wait.

I've just taken a cursory look at the n_tty_close code now and it appears to
wake up any processes that are blocked on a read but not ones that are blocked
on a write.

You might just want to do a timed-out select() or poll(), and then do
non-blocking writes to the tty.


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