Streams Loop-Around driver...

Mark Hamilton markh at ico.UUCP
Sat Jan 24 02:19:57 AEST 1987


In article <1341 at cadovax.UUCP>, mitchell at cadovax.UUCP (Mitchell Lerner) writes:
> Is the Loop-Around driver as shown in the the System V version 3 Streams 
> Programmers Guide in chapter 12 a way that I can do inter-process 
> communication?  I'm not sure that you can actualy open the driver from streams 
> on two separate processes (or more?) and have the driver connect the two 
> streams.  Can I use this type of Streams driver as the basis for an inter-
> process communications facility?

Yes, you can open this device from two separate processes and connect them.
Each process should perform a clone open (assuring a unique minor number),
and then one of the processes should do a "LOOP_SET" ioctl.  (Actually both
could do the ioctl if they are prepared to ignore the EBUSY error.)  You
cannot connect more than two streams in this way, as each extra connect
returns EBUSY, however, it should be fairly easy to add the ability to do
that if you know what the semantics should be.

As an aside, you may want to consider the stream-pipe device which I believe
is part of the standard V.3 distribution (/dev/spx).  The operation of the
device simulates a pipe between two processes, but you have the added
advantage of being able to push other modules onto the "pipe".
-- 
Mark Hamilton
InterActive Systems



More information about the Comp.unix.wizards mailing list