| |||
| Home > The C and C++ Libraries > Tailoring error signaling, error handling, and program exit > __raise() | |||
This function raises a signal to indicate a runtime anomaly.
int __raise(int signal, int type);
where:
signalIs an integer that holds the signal number.
typeIs an integer or string constant or variable.
This function calls the normal C signal mechanism or the default signal handler. See also _ttywrch() for more information.
You can replace the __raise() function
by defining:
int __raise(intsignal, inttype)
This enables you to bypass the C signal mechanism and its data-consuming signal handler vector, but otherwise gives essentially the same interface as:
void __default_signal_handler(int signal, int type);
Also, see Thread‑safety in the ARM C libraries.
There are three possibilities for __raise() return
condition:
The handler performs a long jump or restart.
The signal was handled.
The calling code
must pass that return value to the exit code. The default library
implementation calls _sys_exit(rc) if __raise() returns
a nonzero return code rc.