Can you poll a pipe?

gaf gaf at uucs1.UUCP
Sat Oct 27 04:59:00 AEST 1990


John R. Levine writes:

>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.)

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.

It is not standard, and it is not an ISC improvement.  Getting X events
from a FIFO doesn't work for me very well.  What happens is they sit there,
all queued up, until some other X event happens (enter, leave, etc).
It seems select() (aka poll()) doesn't reject events from FIFOs, but if 
data on a FIFO is the only event happening, select() won't return.  When
some other event happens, the FIFO data gets read then.  It's a pity.
-- 
Guy Finney					It's that feeling of deja-vu
UUCS inc.   Phoenix, Az				all over again.
ncar!noao!asuvax!hrc!uucs1!gaf	sun!sunburn!gtx!uucs1!gaf



More information about the Comp.unix.internals mailing list