Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (t - z) terminate_program(3)
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 and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
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
identifies 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 specified, the default is zero.
SPI_ssid Species the subsystem ID (SSID) that identifies the subsystem defining
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 specified, 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 files any data left in the buffers, closes files,
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_.
527192-018 Hewlett-Packard Company 711