[comp.sys.amiga.tech] Asynch Process creation

jim@b11.INGR.COM (Jim Levie ) (02/13/89)

A question for the wizards out there...

I need to be able to (from a CLI process) startup another process that will
run asynchronously, inherit specified input and output streams, and return
exit status to the parent process.  I can't use input and output redirection
because the data streams will need to be used for a succession of sub-processes
and I can't allow the output stream to be opened and closed by each sub-process.
Ideally the sub-processes would be ordinary C programs that read from stdin 
and write to stdout.

Using Manx's fexecv() and mucking about with the pr_CIS and pr_COS I can do it
synchronously, but not asynchronously.  Using Manx's detach isn't any good
either since a 'detached' process doesn't inherit the input and output
streams.

I thought that the ARP ASynchRun() call would do, but I've not been able to
get it to work.  Also I'd prefer not to use something that would require
dependence on something that I did not have source to and that might not work
in later OS releases.

CreateProc() comes close, but I can't see any way to get the input and output
streams set up before the sub-process starts executing.


-- 
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
 Jim Levie   REMTECH Inc  Huntsville, Al 
 The opinions expressed above are just that.
 Ph.    (205) 536-8581               email: uunet!ingr!b11!jim