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


>
> 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?




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