Xref: utzoo comp.unix.internals:811 comp.unix.sysv386:1527 Path: utzoo!attcan!uunet!ogicse!husc6!spdcc!esegue!johnl From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.unix.internals,comp.unix.sysv386 Subject: Can you poll a pipe? Message-ID: <1990Oct24.184556.853@esegue.segue.boston.ma.us> Date: 24 Oct 90 18:45:56 GMT Reply-To: johnl@iecc.cambridge.ma.us (John R. Levine) Distribution: na Organization: I.E.C.C., Cambridge MA Lines: 22 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@esegue.segue.boston.ma.us, {ima|spdcc|world}!esegue!johnl Atlantic City gamblers lose $8200 per minute. -NY Times