Signal handling (signal.h)¶
Include signal.h for signal constants and abnormal program
termination.
Types and Macros¶
| Name | Meaning |
|---|---|
SIGABRT |
Abnormal termination signal (abort). |
SIGFPE |
Erroneous arithmetic operation. |
SIGILL |
Illegal instruction. |
SIGINT |
Interactive attention signal. |
SIGSEGV |
Invalid memory access. |
SIGTERM |
Termination request. |
_sig_fn_t |
Signal handler function type. |
SIG_DFL |
Default signal action: terminate the program. |
SIG_IGN |
Ignore the signal. |
SIG_ERR |
Returned by signal() on error. |
The signal numbers and handler constants provide C89 source compatibility. CP/M does not install or deliver asynchronous signal handlers.
Functions¶
| Function | Summary |
|---|---|
int raise(int sig) |
Send signal sig to the running program. SIGABRT calls abort(); all other signals are no-ops on CP/M 2.2. |
void (*signal(int sig, void (*func)(int)))(int) |
Install func as the handler for signal sig; returns the previous handler or SIG_ERR. On CP/M 2.2 there is no async signal delivery, so SIG_ERR is always returned. |
Runtime model¶
signal() always returns SIG_ERR; neither SIG_DFL, SIG_IGN, nor a
user-provided handler can be installed on CP/M 2.2.
raise(SIGABRT) calls abort() and does not return. Raising any other defined
signal is a no-op that returns zero.