Borland C++ reference

raise

raw OCR

Sends a software signal to the executing program.

Defined in header <signal.h>

Syntax

#include <signal.h>
int raise(int sig);

Portability

DOSUNIXWindowsANSI CC++ 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:

SignalMeaning
SIGABRTAbnormal termination (*)
SIGFPEBad floating-point operation
SIGILLIllegal instruction (#)
SIGINTControl break interrupt
SIGSEGVInvalid access to storage (#)
SIGTERMRequest 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.