$ Verify = F$Verify(0) $ $ ! If there is a process called "Sedt_ttcn" then ATTACH to it $ ! because it's the waiting Sedt. $ ! If not just SPAWN an Sedt with the p1 ... p8 parameters $ $ If "''SEDT$Process_Version'" .eqs. "" then SEDT$Process_Version == 0 $ Sedt_name = "Sedt_" + - F$Extract(4,4,F$Getjpi(0,"pid")) + - "_" + - F$String(SEDT$Process_Version) $ priv_list = f$setprv( "NOWORLD, NOGROUP" ) $ pid = 0 $ $ 10$: $ proc = f$getjpi( f$pid( pid ), "PRCNAM" ) $ if proc .eqs. Sedt_name then Goto attach $ if pid .ne. 0 then $ goto 10$ $ spawn: $ priv_list = f$setprv( priv_list ) $ $ write sys$error - "[Spawning a new Kept Sedt]" $ SEDT$Process_Version == SEDT$Process_Version + 1 $ Sedt_name = "Sedt_" + - F$Extract(4,4,F$Getjpi(0,"pid")) + - "_" + - F$String(SEDT$Process_Version) $ Set control=y $ Define/user_mode sys$input sys$command $ Spawn /process="''Sedt_name'" - /nolog - $Sedt/parent='F$Getjpi(0,"pid")' - /Command=Sedt$Library:Sedtini.Ini - 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8 $ write sys$error - "[Attached to DCL in directory ''f$logical("SYS$DISK")'''f$directory()']" $ $ If Verify then Set Verify $ exit $ $ Attach: $ If P1 .eqs. "" then Goto Really_Attach $ Stop "''Sedt_name'" $ Wait 0:0:3 $ Goto Spawn $ Really_Attach: $ priv_list = f$setprv( priv_list ) $ $ write sys$error - "[Attaching to Kept Sedt]" $ Define/user_mode sys$input sys$command $ attach "''Sedt_name'" $ write sys$error - "[Attached to DCL in directory ''f$logical("SYS$DISK")'''f$directory()']" $ If Verify then Set Verify $ exit