Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!POSTGRES.BERKELEY.EDU!dillon From: dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga.tech Subject: Re: fork() (not forkv()!) on Amiga? Message-ID: <8910110036.AA13975@postgres.Berkeley.EDU> Date: 11 Oct 89 00:36:06 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 59 :Here's another moderately related question on executing programs. :I need to call a program from within mine. I've found several ways :to do this: : : 1) LoadSeg, CreateProc, UnloadSeg : 2) Lattice forkv() or forkl() : 3) Lattice system() : 4) Execute() One thing to note: In OS1.4, all C: programs will be written in C. Thus, Lattice's fork*() calls should work just fine then. I talked to John Toebes 'bout this. They didn't make fork*() compatible w/ BCPL programs because you need to do a lot of unsupported structure munging to setup the global vectors right. So Lattice is using a more supportable method with its fork*() calls at the expense of BCPL compatibility. :Unfortunately they each seem to have problems. The Lattice forkv() :call causes a GURU when it tries to execute almost anything in the c: :directory. It also GURU's on a few other things as well - this :behaviour makes its use unacceptable. : :Lattice system() call will not accept input and output file streams :to let me redirect the output or input of a command. : :Execute() comes close, but I can find no way to obtain the return code :of the executed command. The Execute() call itself always returns :-1, and IoErr() always contains zero. I need to be able to examine the :return code. Was the Execute() return code problem going to be fixed in 1.4? That and properly disconnecting the console device. Rightly, if RUN detects NIL: it ought to fill in pr_ConsoleDevice with a dummy console (like NULL:) :LoadSeg, CreateProc, UnloadSeg has no apparent way to pass command line :parameters to a command. Also, I've heard that it will also crash on :c: programs. CreateProc() has no apparent way to pass command line params to the command. You need to CreateProc() to a tag that sets up all the process fields properly and then there is the question of what to do about the CLI pointer... :So, how do you do it? There must be an easy way to execute a program :that won't crash on some programs, and will let you have the return :code back from the command, and lets you redirect I/O. : : - thanks : : steve (koren@hpfela.HP.COM) 1.4 is really comming together... it isn't vapor and developers have received 1.4 alpha 16 for testing... it's pretty solid. I think the issue will not be resolved until 1.4 comes out. -Matt