C raise function sends the specified by signal to the executing program

Syntax

C raise function has the following syntax.

int raise(int signal);

C raise function is from header file signal.h.

Description

C raise function sends the specified by signal to the executing program and returns 0 on success or nonzero on failure.

The following signals are defined by Standard C.

Macro Meaning
SIGABRT Termination error
SIGFPEFloating-point error
SIGILL Bad instruction
SIGINT User pressed CTRL-C
SIGSEGV Illegal memory access
SIGTERMTerminate program

Example

Send the specified by signal to the executing program by using C raise function.


#include <signal.h>
/* w w  w .  ja v a 2  s .c  o  m*/
int main(void){
   raise(SIGTERM);

}

The code above generates the following result.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h