le_signals.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* le_sig_EventHandlerFunc_t) (int sigNum)
 

Functions

void le_sig_Block (int sigNum)
 
void le_sig_SetEventHandler (int sigNum, le_sig_EventHandlerFunc_t sigEventHandler)
 
void le_sig_DeleteAll (void)
 
void le_sig_InstallShowStackHandler (void)
 
void le_sig_InstallDefaultTermHandler (void)
 

Detailed Description

Legato Signals API include file.

Typedef Documentation

◆ le_sig_EventHandlerFunc_t

typedef void(* le_sig_EventHandlerFunc_t) (int sigNum)

Prototype for the signal event handler functions.

Function Documentation

◆ le_sig_Block()

void le_sig_Block ( int  sigNum)

Blocks a signal in the calling thread.

Signals that an event handler will be set for must be blocked for all threads in the process. To ensure that the signals are blocked in all threads call this function in the process' first thread, all subsequent threads will inherit the signal mask.

Note
Does not return on failure.
Parameters
[in]sigNumSignal to block.

◆ le_sig_DeleteAll()

void le_sig_DeleteAll ( void  )

Removes all signal event handlers for the calling thread and cleans up any resources used for signal events. This should be called before the thread exits.

◆ le_sig_InstallDefaultTermHandler()

void le_sig_InstallDefaultTermHandler ( void  )

Install a default handler to handle the SIGTERM signal. Called automatically by main().

◆ le_sig_InstallShowStackHandler()

void le_sig_InstallShowStackHandler ( void  )

Install handler to show stack and signal informations on SIGSEGV/ILL/BUS/TRAP/FPE signals. Called automatically by main().

◆ le_sig_SetEventHandler()

void le_sig_SetEventHandler ( int  sigNum,
le_sig_EventHandlerFunc_t  sigEventHandler 
)

Sets a signal event handler for the calling thread. Each signal can only have a single event handler per thread. The most recent event handler set will be called when the signal is received. sigEventHandler can be set to NULL to remove a previously set handler.

Note
sigNum Cannot be SIGKILL or SIGSTOP or any program error signals: SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGABRT, SIGIOT, SIGTRAP, SIGEMT, SIGSYS.
Does not return on failure.
Parameters
[in]sigNumSignal to set the event handler for. See parameter documentation in comments above.
[in]sigEventHandlerEvent handler to call when a signal is received.