On Thu, 21 Jan 2010 00:05:25 +0000, Ted MacNEIL wrote:
>>We have several batch jobs that spawn (forked) additional address spaces with
>>a number append to the jobname.
>>These jobs execute BPXBATCH or BPXBATSL.
>>Is there a way to have these jobs use the current job address space instead
>>of starting a new one?
>
>Unfortunately, NO.
>I went through the same thing, when we first implemented UNIX System Services.
>This is z/OS's (previously ESA 5.2 & OS/390) method of emulating the UNIX fork
>of a process.
>A spawn is even 'worse', since the originating address space goes away.
>
Nowadays, with _BPX_SHAREAS=MUST, spawn will use the parent address
space. I strongly disagree with your statement that "the originating
address space goes away." I regularly do:
address SYSCALL spawn
Child = RETVAL
...
/* Do something else in parent while child runs. */
...
address SYSCALL waitpid Child
Change 'spawn' 'exec' ALL ?
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html