MicrOS
|
Go to the source code of this file.
Macros | |
#define | SIGABRT 0 |
(Signal Abort) Abnormal termination, such as is initiated by the abort function. More... | |
#define | SIGFPE 1 |
(Signal Floating-Point Exception) Erroneous arithmetic operation, such as zero divide or an operation resulting in overflow (not necessarily with a floating-point operation). More... | |
#define | SIGILL 2 |
(Signal Illegal Instruction) Invalid function image, such as an illegal instruction. This is generally due to a corruption in the code or to an attempt to execute data. More... | |
#define | SIGINT 3 |
(Signal Interrupt) Interactive attention signal. Generally generated by the application user. More... | |
#define | SIGSEGV 4 |
(Signal Segmentation Violation) Invalid access to storage: When a program tries to read or write outside the memory it has allocated. More... | |
#define | SIGTERM 5 |
(Signal Terminate) Termination request sent to program. More... | |
#define | SIG_IGN 0 |
Ignore Signal: The signal is ignored. More... | |
#define | SIG_DFL 1 |
Default handling: The signal is handled by the default action for that particular signal. More... | |
#define | SIG_ERR 2 |
Special return value indicating failure. More... | |
Typedefs | |
typedef int32_t | sig_atomic_t |
Integral type. More... | |
typedef void(* | signal_func) (int) |
Signal function signature. More... | |
Functions | |
int | raise (int sig) |
Generates a signal. More... | |
int | raise_with_param (int sig, int param) |
Generates a signal with the specified parameter. More... | |
void | default_sigabrt_handler (int param) |
Default signal handle for SIGABRT. More... | |
void | default_sigfpe_handler (int param) |
Default signal handle for SIGFPE. More... | |
void | default_sigill_handler (int param) |
Default signal handle for SIGILL. More... | |
void | default_sigint_handler (int param) |
Default signal handle for SIGINT. More... | |
void | default_sigsegv_handler (int param) |
Default signal handle for SIGSEGV. More... | |
void | default_sigterm_handler (int param) |
Default signal handle for SIGTERM. More... | |
void | __signal_init () |
Initialize default signal handlers. More... | |
signal_func | __signal_get_defualt_handler (int sig) |
Get default handler for the specified signal. More... | |
Variables | |
signal_func | signal_handlers [6] |
Array containing all signal handlers. More... | |
void(*)(int) | signal (int sig, signal_func func) |
Set function to handle signal. More... | |
#define SIG_DFL 1 |
Default handling: The signal is handled by the default action for that particular signal.
#define SIG_ERR 2 |
Special return value indicating failure.
#define SIG_IGN 0 |
Ignore Signal: The signal is ignored.
#define SIGABRT 0 |
(Signal Abort) Abnormal termination, such as is initiated by the abort function.
#define SIGFPE 1 |
(Signal Floating-Point Exception) Erroneous arithmetic operation, such as zero divide or an operation resulting in overflow (not necessarily with a floating-point operation).
#define SIGILL 2 |
(Signal Illegal Instruction) Invalid function image, such as an illegal instruction. This is generally due to a corruption in the code or to an attempt to execute data.
#define SIGINT 3 |
(Signal Interrupt) Interactive attention signal. Generally generated by the application user.
#define SIGSEGV 4 |
(Signal Segmentation Violation) Invalid access to storage: When a program tries to read or write outside the memory it has allocated.
#define SIGTERM 5 |
(Signal Terminate) Termination request sent to program.
typedef int32_t sig_atomic_t |
Integral type.
Integral type of an object that can be accessed as an atomic entity, even in the presence of asynchronous signals. !
typedef void(* signal_func) (int) |
Signal function signature.
signal_func __signal_get_defualt_handler | ( | int | sig | ) |
Get default handler for the specified signal.
Gets default signal handler based on the passed signal type.
void __signal_init | ( | ) |
Initialize default signal handlers.
Assign default signal handlers to the internal array.
void default_sigabrt_handler | ( | int | param | ) |
Default signal handle for SIGABRT.
This handler can be set by passing SIG_DFL in sig parameter in signal function.
param | Signal parameter. |
void default_sigfpe_handler | ( | int | param | ) |
Default signal handle for SIGFPE.
This handler can be set by passing SIG_DFL in sig parameter in signal function.
param | Signal parameter. |
void default_sigill_handler | ( | int | param | ) |
Default signal handle for SIGILL.
This handler can be set by passing SIG_DFL in sig parameter in signal function.
param | Signal parameter. |
void default_sigint_handler | ( | int | param | ) |
Default signal handle for SIGINT.
This handler can be set by passing SIG_DFL in sig parameter in signal function.
param | Signal parameter. |
void default_sigsegv_handler | ( | int | param | ) |
Default signal handle for SIGSEGV.
This handler can be set by passing SIG_DFL in sig parameter in signal function.
param | Signal parameter. |
void default_sigterm_handler | ( | int | param | ) |
Default signal handle for SIGTERM.
This handler can be set by passing SIG_DFL in sig parameter in signal function.
param | Signal parameter. |
int raise | ( | int | sig | ) |
Generates a signal.
The signal value to raise.
sig | The signal value to which a handling function is set. |
int raise_with_param | ( | int | sig, |
int | param | ||
) |
Generates a signal with the specified parameter.
The signal value to raise.
sig | The signal value to which a handling function is set. |
param | The signal parameter. |
void(*)(int) signal(int sig, signal_func func) |
Set function to handle signal.
Specifies a way to handle the signals with the signal number specified by sig.
sig | The signal value to which a handling function is set. |
func | A pointer to a function. This may either be a function defined by the programmer or one of the following predefined functions: SIG_DFL (handle) or SIG_IGN (ignore). |
signal_func signal_handlers[6] |
Array containing all signal handlers.