raise

Sends a signal to the executing program.

Library:LibC
Classification:ANSI
Service:Signal Services

Syntax

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

Parameters

sig

(IN) Specifies the condition for which to raise a signal. For a list of signals, see Section 5.1, Standard Signals.

Return Values

If successful, returns 0. Otherwise, returns nonzero and sets errno to the following:

Decimal

Constant

Description

9

EINVAL

The value of the sig parameter is invalid or unsupported.

Remarks

The raise function supports two types of behavior:

  • If POSIX semantics are not being used, only SIGTERM, SIGABRT, and SIGINT are supported. All other signal values are ignored. This function always returns 0 for non-POSIX NLMs.

  • If POSIX semantics are in effect, the raise function signals the exception condition indicated by the sig parameter. The signal function can be used to specify the action to take place when a signal is raised.

There can be no return of control following a call to the raise function if the action for that condition is to terminate the program or to transfer control using longjmp.

See Also