Xref: utzoo comp.unix.internals:907 comp.unix.sysv386:1712 Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!ncar!ico!dougm From: dougm@ico.isc.com (Doug McCallum) Newsgroups: comp.unix.internals,comp.unix.sysv386 Subject: Re: Can you poll a pipe? Message-ID: <1990Oct31.150848.22080@ico.isc.com> Date: 31 Oct 90 15:08:48 GMT References: <1990Oct24.184556.853@esegue.segue.boston.ma.us> <345@uucs1.UUCP> <1990Oct28.035350.26736@ico.isc.com> <1990Oct30.133825.19829@balkan.TNT.COM> Reply-To: dougm@ico.ISC.COM (Doug McCallum) Distribution: na Organization: Interactive Systems Corp., Boulder CO Lines: 38 In article <1990Oct30.133825.19829@balkan.TNT.COM> wgb@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@ico.isc.com