llvm::sys::SetInterruptFunction

Register a function to be called when the user interrupts the program.

Synopsis

Declared in <llvm/Support/Signals.h>

void
SetInterruptFunction(void(* IF)());

Description

This function registers a function to be called when the user "interrupts" the program (typically by pressing ctrl-c). When the user interrupts the program, the specified interrupt function is called instead of the program being killed, and the interrupt function automatically disabled.

Note that interrupt functions are not allowed to call any non-reentrant functions. An null interrupt function pointer disables the current installed function. Note also that the handler may be executed on a different thread on some platforms.

Parameters

NameDescription
IFInterrupt function to install, or null to disable the current handler.