raise

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at raise.

Sends a signal to the executing program.

System_CAPS_ICON_note.jpg Note

Do not use this method to shut down a Windows 8.x Store app, except in testing or debugging scenarios. Programmatic or UI ways to close a Windows 8.x Store app are not permitted according to Section 3.6 of the Windows 8 app certification requirements. For more information, see Application lifecycle (Windows Store apps).

  
      int raise(  
int sig   
);  

Parameters

sig
Signal to be raised.

If successful, raise returns 0. Otherwise, it returns a nonzero value.

The raise function sends sig to the executing program. If a previous call to signal has installed a signal-handling function for sig, raise executes that function. If no handler function has been installed, the default action associated with the signal value sig is taken, as follows.

SignalMeaningDefault
SIGABRTAbnormal terminationTerminates the calling program with exit code 3
SIGFPEFloating-point errorTerminates the calling program
SIGILLIllegal instructionTerminates the calling program
SIGINTCTRL+C interruptTerminates the calling program
SIGSEGVIllegal storage accessTerminates the calling program
SIGTERMTermination request sent to the programIgnores the signal

If the argument is not a valid signal as specified above, the invalid parameter handler is invoked, as described in Parameter Validation. If not handled, the function sets errno to EINVAL and returns a nonzero value.

RoutineRequired header
raise<signal.h>

For additional compatibility information, see Compatibility.

All versions of the C run-time libraries.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Process and Environment Control
abort
signal

Show: