Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!rutgers!mit-eddie!uw-beaver!uw-june!ka From: ka@june.cs.washington.edu (Kenneth Almquist) Newsgroups: comp.unix.wizards Subject: Re: STREAMS module / dup question Message-ID: <8217@june.cs.washington.edu> Date: 14 May 89 09:28:53 GMT References: <569@lehi3b15.csee.Lehigh.EDU> Organization: U of Washington, Computer Science, Seattle Lines: 24 murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) asks: > What if: > 1. I open a STREAM. [ UNIX System v.3.1 ] > 2. I dup that stream, so now I have 2 fd's referring to > that stream. > 3. I push a module on one of the fd's. > > Questions: > 1. Do both of those fd's have that module pushed on it? Yes. > 2. What happens during a fork()? Both the parent and the child share the stream. For example, if the child process pushes a module onto the stream, and then the parent process does a read from the stream, the input to the parent process will pass through the module that the child process pushed onto the stream. (Disclaimer: This is what I think it should do. I haven't actually tested the code.) Kenneth Almquist