raise
Sends a software signal to the executing program.
Defined in header <signal.h>
Syntax
#include <signal.h>
int raise(int sig);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ | ■ |
Remarks
raise sends a signal of type sig to the program. If the program has installed a signal handler for the signal type specified by sig, that handler will be executed. If no handler has been installed, the default action for that signal type will be taken.
The signal types currently defined in signal.h are noted here:
| Signal | Meaning |
| SIGABRT | Abnormal termination (*) |
| SIGFPE | Bad floating-point operation |
| SIGILL | Illegal instruction (#) |
| SIGINT | Control break interrupt |
| SIGSEGV | Invalid access to storage (#) |
| SIGTERM | Request for program termination (*) |
Signal types marked with a {*) aren't generated by DOS or Borland C++ during normal operation. However, they can be generated with raise. Signals marked by (#) can't be generated asynchronously on 8088 or 8086 processors but can be generated on some other processors (see signal for details).
Return value
raise returns 0 if successful, nonzero otherwise.
See also
Example
#include <signal.h>
int mainO
int a, b;
a = 10;
b = 0;
if (b == 0)
raise(SIGFPE); /* preempt divide by zero error */
a = a / b;
return
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/signal.h/raise/
· short form /3.1/raise/