ILE C/C++ Programmer's Guide

Signal Handling Function Prototypes

The header file <signal.h> contains a number of function prototypes that are associated with signal handling.

The following functions can be used with signal handling in your program:

The _GetExcData() function is an ILE C/C++ extension that allows you to obtain information about the exception message associated with the signal and returns a structure containing information about the exception message. The _GetExcData() function returns the same structure that is passed to the #pragma exception_handler directive.

The signal() function specifies the action that is performed when a signal is raised. There are ten signals that are represented as macros in the <signal.h> header file. In addition, the macro SIGALL has the semantics of a signal but with some unique characteristics. The ten signals are as follows:

SIGABRT
Abnormal program end.

SIGFPE
Arithmetic operation error, such as dividing by zero.

SIGILL
An instruction that is not allowed.

SIGINT
System interrupt, such as receiving an interactive attention signal.

SIGIO
Record file error condition.

SIGOTHER
All other *ESCAPE and *STATUS messages that do not map to any other signals.

SIGSEGV
The access to storage is not valid.

SIGTERM
A end request is sent to the program.

SIGUSR1
Reserved for user-defined signal handler.

SIGUSR2
Reserved for user-defined signal handler.

SIG_IGN and SIG_DFL are signal actions that are also included in the <signal.h> header file.

SIG_IGN
Ignore the signal.

SIG_DFL
Default action for the signal.

SIGALL is an ILE C/C++ extension that allows you to register your own default-handling function for all signals whose action is SIG_DFL. This default-handling function can be registered by using the signal() function with SIGALL, as shown in the example section. A function check is not a signal and cannot be monitored for by the signal function. SIGALL cannot be signaled by the raise() function.


[ Top of Page | Previous Page | Next Page | Table of Contents ]