Can you poll a pipe?

Doug McCallum dougm at ico.isc.com
Thu Nov 1 02:08:48 AEST 1990


In article <1990Oct30.133825.19829 at balkan.TNT.COM> wgb at balkan.TNT.COM (William G. Bunton) writes:
...
>And I've been told in no uncertain terms that it doesn't work on
>tty's.  In fact, I've been told that because it's not supported on
>tty's, that is a valid reason for it to hang the entire vt/console
>subsystem.

Who at ISC has told you it doesn't work?  In any case, I compiled your program
and ran it on several different systems; 2.0.2, 2.2 and one that is a little
beyond 2.2.  It has the correct behavior on all of them.  The vt/console
subsystem does not hang.  The program exits as soon as a newline is entered
as it should.  The poll blocks until the newline if a tty is in canonical
input mode.

>
>I'd like to suggest it wasn't done completely for tty's either, and
>maybe someone ought to check up on it.

All of my attempts to duplicate your problems fail.  I have heard that
poll doesn't work quite right on a COM port that is being used with
modem signals but has a cable that isn't correctly wired.  I haven't tried
that; I'm not part of support, just someone that wants to help and don't
really have the time to try strange wiring schemes.

The modifications are in the generic tty code so should work the same way
on the console, a COM port or other tty unless the standard tty code has
been replaced in some way (like with a different line discipline).
Because of poll being done in the generic code, poll should not be able
to lock the vt/console subsystem.  The poll code sits above it.

The only time I would expect problems is if you are running a default
configuration but trying to run more than 32 applications all using poll
(or select) on a tty device at the same time or if you changed the value
of NXTTY in /etc/conf/pack.d/kernel/space.c inappropriately.

Doug McCallum
Interactive Systems Corp.
dougm at ico.isc.com



More information about the Comp.unix.internals mailing list