From: SMTP%"winalski@adserv.enet.dec.com" 26-MAY-1993 08:28:28.62 To: EVERHART CC: Subj: Re: Exec, Spawn, Objects in VMS X-Newsgroups: comp.sys.dec,comp.os.vms,vmsnet.misc From: winalski@adserv.enet.dec.com (Paul S. Winalski) Subject: Re: Exec, Spawn, Objects in VMS Message-Id: <1993May25.152103.6262@dbased.nuo.dec.com> Lines: 39 Sender: news@dbased.nuo.dec.com (USENET News System) Reply-To: winalski@adserv.enet.dec.com (Paul S. Winalski) Organization: Digital Equipment Corporation, Nashua NH X-Newsreader: mxrn 6.18-4 Date: Tue, 25 May 1993 15:21:03 GMT To: Info-VAX@kl.sri.com X-Gateway-Source-Info: USENET In article <1993May25.101807.8847@visionware.co.uk>, chetanm@visionware.co.uk (Chetan Mistry) writes: |> |> Whats the best way to exec another program with another program. ? |>I have a DECnet object which listens for connections and then opens |>"SYS$NET" channel to read information about which server it has to fire off. |>The server program should use the same channel (ie. "SYS$NET") to talk to |>the remote program. This is not the way that DECnet-VAX is designed to operate. The way you're supposed to use it is to define a separate object for each server. The Unix inetd model is not the DECnet paradigm. In trying to do something like this, you're faced with two major problems: 1) One and only one I/O channel can be opened on SYS$NET:. All DECnet communications have to take place over that channel. In particular, a subprocess cannot access its parent's DECnet link. 2) Once you close SYS$NET:, the DECnet link is broken. This means that if you open SYS$NET: from within a program (i.e., in user mode), you cannot run another program in that process and have it talk over the DECnet channel (because I/O rundown of the first program will close the DECnet link). The easiest way around these difficulties is to open SYS$NET: for read and write access from DCL. Define your DECnet object to run a command procedure. Within the procedure, accept the logical link using a DCL OPEN statement: $ OPEN/READ/WRITE NETCHAN SYS$NET: You now have the DECnet link open as a process-permanent file, which means that it won't be closed upon exit of a user-mode program. You can now access it from within programs using logical name NETCHAN. Your program that reads the info about which server to fire off can then use LIB$RUN_PROGRAM to run the correct server. --PSW