Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>raise() send a software signal</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 raise()                 Send a Software Signal

 #include   <signal.h>                   Required for declarations only

 int raise(sgnal);
 int sgnal;     Signal to send

        The raise() function lets a program send signals to itself. Signal
        types are as defined in signal.h as follows:

                    SIGABRT     Abnormal termination
                    SIGFPE      Floating point error
                    SIGILL      Illegal instruction
                    SIGINT      .nterrupt
                    SIGSEGV     Illegal storage access
                    SIGTERM     Request for program termination

    Returns:    0 if successful; nonzero otherwise.

   -------------------------------- Example ---------------------------------
        This example avoids a divide by zero:

 #include <signal.h>

 int main(void)

    int var1, var2, result1;

    var1 = 1;
    var2 = 2;
    if (var2 == 0)
       raise(SIGFPE);   // Indicate bad floating point operation
    result1 = var1 / var2;
    return 0;


See Also: abort() signal()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson