Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

terminate_program(3) Guardian Native C Library Calls Reference Manual
NAME
terminate_program - Terminates a process
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
SYNOPSIS
#include <stdlib.h>
void terminate_program (
short dummy,
short options,
short completion_code,
short termination_info,
short *SPI_ssid,
char *text,
short text_length);
PARAMETERS
dummy is always a zero.
options Species whether the process is being stopped because of a normal or abnormal
condition. Specify 0 (zero) for normal termination (STOP). Specify 1 for abnor-
mal termination (ABEND). The default is zero.
completion_code
Species the completion code to be returned to the parent process in the process
deletion system message. Specify this parameter only if the calling process is
terminating itself and you want to return a completion code value other than the
default of zero (STOP) or 5 (ABEND).
termination_info
Species the Subsystem Programmatic Interface (SPI) error number that
identies what caused the process to stop itself. For more information on SPI
error numbers and subsystem IDs, refer to the SPI Programming Manual.If
termination_info is not specied, the default is zero.
SPI_ssid Species the subsystem ID (SSID) that identies the subsystem dening
termination_info. The format and use of the SSID is described in the SPI Pro-
gramming Manual.
text Species an optional string of ASCII text to be sent as part of the process dele-
tion message. If text is specied, text_length cannot be zero.
text_length Species the length of the text string, if present. The value of text_length cannot
be longer than the number of bytes of text . The maximum length is 80 bytes.
DESCRIPTION
The terminate_program( ) function writes to open les any data left in the buffers, closes les,
passes all of the allowed information to the Guardian system procedure PROCESS_STOP_, and
terminates execution of the program.
The terminate_program( ) function is similar to the exit() function but can be used to pass all of
the allowed information to the Guardian system procedure PROCESS_STOP_.
76 Hewlett-Packard Company 527192-005