STREAMS module / dup question
Kenneth Almquist
ka at june.cs.washington.edu
Sun May 14 19:28:53 AEST 1989
murrey at 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
More information about the Comp.unix.wizards
mailing list