Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (P)
Guardian Procedure Calls Reference Manual522629-013
12-201
PROCESS_STOP_ Procedure
reference page either online or in the Open System Services System Calls
Reference Manual.
Rules for stopping any process: stop mode
When a process tries to stop another process, another item checked is the stop
mode of that process. The stop mode is a value associated with every process
that determines what other processes can stop it. The stop mode, set by the
SETSTOP procedure, is defined as follows:
0 Any other process can stop the process.
1 Only the process qualified by the above rules can stop the process.
2 No other process can stop the process.
The process can always stop itself.
Errors other than 0 can be returned by PROCESS_STOP_ under the following
conditions:
If the process (or process pair) does not exist, error 11 is returned.
If the stop request passes the security checks but the process is running at
stop mode 2, the stop request is queued pending the reduction of the stop
mode to 1. Error 638 is returned.
If the stop request does not pass the security checks and the process is
running at stop mode 1 or 2, the stop request is queued pending the reduction
of the stop mode to 0. Error 639 is returned.
If it is not possible to communicate with the processor where the process is
running, error 201 is returned.
Returning control to the caller before the process is stopped
When
error is 0, 638, or 639, PROCESS_STOP_ returns control to the caller
before the specified process is actually stopped. If
error is 0, the process does
not execute any more user code. However, you should make sure that the process
has terminated before you attempt to access a file that the process had open with
exclusive access or before you try to create a new process with the same name.
The best way to be sure that a process has terminated is to wait for the process
deletion message.
Stopping a process that has the Inspect or saveabend attribute set
If the process being stopped has either the Inspect attribute or the saveabend
attribute set, and if DMON exists, PROCESS_STOP_ returns error 0 but deletion
of the process is delayed until DMON approves it. In the case of an abnormal
termination (ABEND), DMON creates a saveabend file if the saveabend attribute is
set.
In response to the PROCESS_STOP_ procedure, the operating system supplies a
completion code in the process deletion message and, for OSS processes, in the
OSS process termination status as follows: