Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>raise() send a signal to executing program</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 raise()                 Send a Signal to Executing Program

 #include   <signal.h>

 int        raise(signal);
 int        signal;                      Signal to raise

    raise() sends 'signal' to whatever program is executing.  If no
    alternate action has been defined using the signal() function, the
    default action will be taken.

    'signal' must be one of the following signals (defined in
    <signal.h>):

              MS-
    Value     DOS  OS/2 Meaning                Default Action
    --------  ---  ---  ---------------------  --------------------------
    SIGABRT   Yes  Yes  Abnormal termination   Terminates calling program
                                               with exit code 3
    SIGBREAK  No   Yes  CTRL+BREAK signal      Terminates calling program

    SIGFPE    Yes  Yes  Floating point error   Terminates calling program

    SIGILL  * Yes  Yes  Illegal Instruction    Terminates calling program

    SIGINT    Yes  Yes  CTRL+C signal          Terminates calling program

    SIGSEGV * Yes  Yes  Illegal storage access Terminates calling program

    SIGTERM * Yes  Yes  Termination request    Terminates calling program

    SIGUSR1   No   Yes  OS/2 process flag A    Signal is ignored

    SIGUSR2   No   Yes  OS/2 process flag B    Signal is ignored

    SIGUSR3   No   Yes  OS/2 process flag C    Signal is ignored

    SIGUSR1, SIGUSR2, and SIGUSR3 are user-defined signals that can be
    sent by means of DOSFLAGPROCESS() in OS/2.

    * Per MSC: These signals are not generated by MS-DOS but are
    supported for ANSI compatibility.

    Returns:    raise() returns 0 if successful.  If not, it returns a
                nonzero value.

   -------------------------------- Example ---------------------------------

    The following statements terminate the program if the file
    "testfile.dat" cannot be opened:

           #include <process.h>    /* for 'abort' (also in <stdlib.h>) */
           #include <stdio.h>      /* for 'fprintf' */

           main()
           {
               FILE *f;

               if ((f = fopen("testfile.dat", "r")) == NULL) {
                    fprintf(stderr, "can't open testfile.dat");
                    raise(SIGABRT);
               }
           }




See Also: signal() abort()

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