Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!munnari.oz.au!csc!ccadfa!cjsv@cs.adfa.oz.au From: cjsv@cs.adfa.oz.au (Christopher J S Vance) Newsgroups: comp.unix.wizards Subject: how do I know when a process wants data Message-ID: <511@ccadfa.adfa.oz.au> Date: 9 Oct 89 08:10:17 GMT Sender: news@ccadfa.adfa.oz.au Organization: Computer Science, Univ. of NSW, ADFA Canberra, Australia Lines: 24 I want to run a process (call it dexec) which fork's and exec's an ordinary Unix process (call it X) using a file descriptor shared with dexec. I want dexec to be notified that X is blocked waiting for input from the shared fd, but cannot expect that X even knows anything is happening. In particular, I cannot compile X, but can compile dexec. The assumption is that dexec can perform some operation to make data appear on the shared fd (although dexec won't be reading this data itself). Another reason for sharing the fd is that I want dexec to know how many characters are left on the fd when X terminates. What mechanism(s) should/can I use to do this? I would rather not poll, but it seems that select does the exact opposite of what I want, since I want to be notified when there is *no* data to read. What are the exceptional conditions alluded to in the documentation for select(2)? Might these help me? In which case, where are they documented? I am running several different varieties of Berklix, as hacked by Pyramid (4.0, 4.4), Sun (3.5, 4.0.3), and Convex (?), and am after a generic solution, because it's supposed to be part of a distributed execution system. Thanks for all responses.