Xref: utzoo comp.unix.internals:896 comp.unix.sysv386:1668 Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!execu!sequoia!balkan!wgb From: wgb@balkan.TNT.COM (William G. Bunton) Newsgroups: comp.unix.internals,comp.unix.sysv386 Subject: Re: Can you poll a pipe? Message-ID: <1990Oct30.133825.19829@balkan.TNT.COM> Date: 30 Oct 90 13:38:25 GMT References: <1990Oct24.184556.853@esegue.segue.boston.ma.us> <345@uucs1.UUCP> <1990Oct28.035350.26736@ico.isc.com> Distribution: na Organization: Tools & Techniques, Inc. Lines: 64 In article <1990Oct28.035350.26736@ico.isc.com> dougm@ico.ISC.COM (Doug McCallum) writes: >In article <345@uucs1.UUCP> gaf@uucs1.UUCP () writes: >... >>That's funny - I've been told by ISC in no uncertain terms that poll() >>doesn't work on a FIFO, since it isn't a streams device. This info came >>back from a bug report I gave them complaining that select() appeared not >>to be working properly on FIFOs. select() calls poll(), and as you say >>poll() only works on streams devices. > >Poll is supposed to work on pipes, ttys and potentially other devices. >hat does not mean it worked under other releases. To be more accurate >about this, poll is supposed to work on pipes and tty devices under 2.2 >and definitely did in the 1.0.6 release. Poll works on tty devices but >did not work on pipes (or FIFOs) under 2.0.1 or 2.0.2. 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. If you compile the short program included at the end of this post, and run it from a tty on 2.2, you will find no VT accepting input until you kill the program. >I just checked and you are correct in the behavior. Apparently when the poll >support was added back in it was not done completely. > >The support for poll on anything other than STREAMS is non-standard and >applications that make use of any extensions (on ISC or SCO or anything else) >are not going to be portable. I'd like to suggest it wasn't done completely for tty's either, and maybe someone ought to check up on it. Doug, I'm certainly not flaming you, I appreciate you and Dick posting. But I am a but pissed off over the response I got from support@isc for a bug report, and was waiting for a chance to respond. Thanks :-) Here's the program: -------------- cut here ------------------ #include #include #include main() { struct pollfd pfd; pfd.fd = 0; pfd.events = POLLIN; poll(&pfd, 1, -1); } ----------- cut here -------------- Bill -- William G. Bunton | An engineer is a man who can do for five bob wgb@balkan.tnt.com | what any bloody fool can do for a quid. Tools & Techniques, Austin, TX | -- origin unknown