16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BPXBATCH<br />

Files<br />

_BPX_BATCH_SPAWN causes BPXBATCH to use SPAWN instead of<br />

fork/exec and allows data definitions to be carried over into the spawned<br />

process. When _BPX_BATCH_SPAWN is set to YES, spawn will be used. If it<br />

is set to NO, which is equivalent to the default behavior, fork/exec will be used<br />

to execute the program.<br />

If _BPX_BATCH_SPAWN is set to YES, then you must consider two other<br />

environment variables that affect spawn (BPX1SPN):<br />

v _BPX_SHAREAS = YES|NO|REUSE|MUST<br />

When YES or REUSE, the child process created by spawn will run in the<br />

same address space. Failure to meet these conditions will result in a spawn<br />

failure when MUST is used. For more detail about these restrictions see the<br />

descriptions of the spawn() function and BPX1SPN callable service in z/<strong>OS</strong><br />

<strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> Programming: Assembler Callable <strong>Services</strong><br />

Reference:<br />

– The invoker must have an UID of 0 to issue a SH request<br />

– The child process is not setuid or setgid to a value different from the<br />

parent<br />

– The spawned file name is not an external link or a sticky bit file<br />

– The parent has enough resources to allow the child process to reside in<br />

the same address space<br />

– The N<strong>OS</strong>HAREAS extended attribute is not set<br />

When no, the child and parent run in separate address spaces.<br />

v _BPX_SPAWN_SCRIPT=YES<br />

Spawn will recognize a header in the first line of a z/<strong>OS</strong> <strong>UNIX</strong> file that<br />

indicates the file to be executed and its first set of arguments. This header<br />

will only be recognized when a z/<strong>OS</strong> <strong>UNIX</strong> file is not found in an executable<br />

format. The format of the header is as follows:<br />

#! Path String<br />

where #! is the file magic number. The magic number indicates that the first<br />

line of a file is a special header that contains the name of the program to be<br />

executed and any argument data to be supplied to it.<br />

When _BPX_SPAWN_SCRIPT=yes, spawn will first recognize the file magic<br />

number and will process the file accordingly. If the file magic number is not<br />

found in the file’s first line, spawn will treat the specified file as a shell script<br />

and will invoke the shell to run the shell script.<br />

For more information about spawn, see BPX1SPN in z/<strong>OS</strong> <strong>UNIX</strong> <strong>System</strong><br />

<strong>Services</strong> Programming: Assembler Callable <strong>Services</strong> Reference.<br />

13. When using BPXBATCH with the SH parameter, environment variables<br />

specified in the STDENV DD are overridden by those specified in /etc/profile<br />

and .profile (which overrides /etc/profile). This is because SH causes<br />

BPXBATCH to execute a login shell which runs the /etc/profile script and runs<br />

the user’s .profile.<br />

v SYS1.LINKLIB(BPXMBATC) is the BPXBATCH program location.<br />

v The stdin default is /dev/null.<br />

v The stdout default is /dev/null.<br />

v The stderr default is the value of stdout. If all defaults are accepted, stderr is<br />

/dev/null.<br />

v stdenv default is /dev/null.<br />

898 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!