Can you poll a pipe?
John R. Levine
johnl at esegue.segue.boston.ma.us
Thu Oct 25 04:45:56 AEST 1990
I am writing some X code in which I want to display items to the screen as
they arrive from a back end via a pipe. To do a reasonable job, I need to
read both X events and pipe data at the same time. Under Sys V, there is
a handy poll() call similar to the BSD select() call that lets you wait until
there is activity on any of a set of file descriptors.
The problem is that, according to the manual, poll() is only guaranteed to
work on Streams devices. A little experimentation shows that under ISC 2.2
polling a pipe works nicely, but it's not clear whether that is standard
behavior or an ISC improvement. (There is such a thing as a streams pipe,
but the standard pipe system call doesn't make one, it makes a nameless FIFO,
as usual.)
Does anyone with experience with other Sys V versions know whether polling
pipes is always supposed to work? Since I only need to do this under X, we
can assume that streams are in the kernel, since without them X won't work.
TIA,
--
John R. Levine, IECC, POB 349, Cambridge MA 02238, +1 617 864 9650
johnl at esegue.segue.boston.ma.us, {ima|spdcc|world}!esegue!johnl
Atlantic City gamblers lose $8200 per minute. -NY Times
More information about the Comp.unix.internals
mailing list