6.13.8 SIGTERM Macro

Signals a termination request.

Attention: This macro is not implemented by MPLAB XC8.

Include

<signal.h>

Remarks

SIGTERM is used as an argument for raise and/or signal. When used, the default behavior is to print a termination request message and terminate the calling program. This may be overridden by a user function that defines the signal handler actions. See signal for an example of a user-defined function.

Example

See the notes at the beginning of this chapter or section for information on using printf() or scanf() (and other functions reading and writing the stdin or stdout streams) in the example code.

#include <signal.h>
#include <stdio.h>

int main(void)
{
  raise(SIGTERM);
  printf("Program never reaches here.");
}

Example Output

TERM

where TERM stands for “termination request.”