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)
 

Detailed Description

Legato Signals API include file.

Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.

Typedef Documentation

typedef void(* le_sig_EventHandlerFunc_t) (int sigNum)

Prototype for the signal event handler functions.

Function Documentation

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.
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.

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.