This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: device open close flow-control
- To: <glibc-linux at ricardo dot ecn dot wfu dot edu>
- Subject: Re: device open close flow-control
- From: "Roland Schwarz" <roland dot schwarz at chello dot at>
- Date: Thu, 11 May 2000 08:07:44 +0200
- References: <Pine.LNX.4.10.10005080944340.21518-100000@ashi.FootPrints.net>
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
>
> 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.
>
That is not the point. I am currently using blocking I/O but use a select on
the
device. If select returns that the device is ready for writing, I can write
without
problems. The problem is when I want to shutdown my program (i.e. by means
of SIGINT) . When I simply do a close the program will hang. On the other
way
if I kill -9 it, the operatig system somehow is able to *force* a close to
the
device. How can I do this forced close?