From: carl@gergl1.gerg.tamu.edu Sent: Tuesday, January 11, 2000 4:26 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: Credit for originating PIPE for VMS Paul Winalski writes... }Regarding the attached: } }Sorry, but PIPE.SHAR was not the first pipe implementation on VMS that }could be used directly in DCL or that ran fast enough to be practical. }I implemented PIPEDRIVR.EXE in 1982. This was a VAX/VMS device driver }implementation of pipes that presented a QIO interface completely }compatible with the existing mailbox driver. The key differences between }the pipe driver and the mailbox driver were: } }(1) The pipe driver took advantage of template device cloning and thus }you could create pipes directly from DCL (using the OPEN command); }creating a mailbox requires a special system service call ($CREMBX) and }is not possible to do directly from the DCL command line (it can be done }by invoking a privileged program to create a mailbox and open a supervisor }mode channel to it). } }Paul Winalski Not that it is entirely relevant to this thread, but... It is, of course, possible to create mailboxes using nothing but DCL. The general method is to "subvert" a mailbox created for other purposes, hijacking it to use as you will. (In the case below, a termination mailbox originally created for use by a spawned subprocess is what is grabbed. There may be other possibilities.) The following is snipped from a post made here in comp.os.vms in 1995 by Anthony C. McCracken (who made some changes to the code, but did not add himself to the initial comment credits). (Note the commented out "pipe" definition, which is one of the things this was originally created to do.) $ vfy = f$verify(0) $! CREATE_MBX E2.3 (Create a mailbox for use from DCL) $!+ $! Skip Morris, "SKIP::MORRIS", 9-July-1986 Based (stolen) from $! ideas and work by Jerry Leichter, Dave Lennig & Elis::Garson. $! $! This procedure creates and opens a mailbox for use from DCL. The $! maiblox is given the process logical name DCL_MBX. If it is run $! multiple times, extra mailboxes are given the names DCL_MBXnn. $!- $ my_pid = f$getjpi("","pid") $ if f$leng(p1) .gt. 0 then goto subprocess $ count = "" $! allow for multiple mailboxes to be created (not to exceed 32 total) $ sanity_count = 0 $loop: $ sanity_count = sanity_count + 1 $ if sanity_count .ge. 32 then exit 4 $ if f$trnlnm("dcl_mbx''count'") .eqs. "" then goto spawn $ count = f$stri(f$inte(count)+1) $ goto loop $spawn: $ dcl_mbx = "dcl_mbx" + count ! logical name used $ procedure = f$envi("procedure") $! spawn a subprocess creating a mailbox... $ spawn/nolog/nowait/out=nl:/proc=crembx_'my_pid' @'procedure' 'my_pid' 'count' $ set process/suspend/id=0 $ mailbox = "mba" + f$trnlnm(dcl_mbx) $ open/read/write 'dcl_mbx' 'mailbox': ! grab mailbox $ deassign/job 'dcl_mbx' ! remove job logical $ set proc/resume crembx_'my_pid' ! Allow subproc to die $ write sys$output f$fao("%CREMBX-I-CREATED, mailbox !AS !AS: created.", - dcl_mbx,f$trnlnm(dcl_mbx)) $! The following may conflict with symbols defined elswhere $! pipe'count' == f$fao("spawn/nowait/nolog/output=!AS:",f$trnlnm(dcl_mbx)) $! grep'count' == f$fao("search !AS:",f$trnlnm(dcl_mbx)) $ exit 1+0*f$verify(vfy) $! $subprocess: $ mailbox = f$getjpi("","tmbu") $ define/nolog/job dcl_mbx'p2' 'mailbox' ! tell parent mbx name $loop: $ set process/resume/id='p1' $ wait 00:00:01.50 $ if f$extr(0,3,f$getjpi(p1,"state")) .eqs. "SUS" $ then $ sanity_check = f$integer("''sanity_check'")+1 $ if sanity_check .gt. 256 then exit %x4 $ goto loop $ endif $ set process/suspend/id=0 $ exit 4+0*f$verify(vfy) --- Carl