|
C-Menu 0.2.9
A User Interface Toolkit
|
Handles signals such as SIGINT, SIGTERM, SIGQUIT, SIGUSR1, and SIGSEGV. More...
Functions | |
| void | sig_dfl_mode () |
| Set signal handlers to default behavior. | |
| void | sig_prog_mode () |
| Set up signal handlers for interrupt signals. | |
| void | signal_handler (int sig_num) |
| Signal handler for interrupt signals. | |
| bool | handle_signal (int sig_num) |
| Handle received signals and prompt user for action. | |
Handles signals such as SIGINT, SIGTERM, SIGQUIT, SIGUSR1, and SIGSEGV.
This module provides functions to set up signal handlers for various signals, handle received signals, and reset signal handlers to their default behavior. It allows the program to respond to interrupt signals by prompting the user for action and ensuring proper cleanup before exiting or continuing execution.
| bool handle_signal | ( | int | sig_num | ) |
Handle received signals and prompt user for action.
| sig_num | The signal number received |
Definition at line 147 of file sig.c.
References em0, em1, em2, f_curses_open, restore_shell_tioctl(), sig_received, ssnprintf(), and strnz__cpy().
| void sig_dfl_mode | ( | ) |
Set signal handlers to default behavior.
This function sets the signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGUSR1, and SIGSEGV to their default behavior. This is typically used when the program needs to exit or reset its signal handling to the default state.
Definition at line 42 of file sig.c.
Referenced by abend(), destroy_curses(), fork_exec(), and main().
| void sig_prog_mode | ( | ) |
Set up signal handlers for interrupt signals.
Upon receiving an interrupt signal (SIGINT, SIGTERM, SIGQUIT), the program will prompt the user to either exit the program or continue execution. If the user chooses to exit, a confirmation prompt will be displayed. If the user opts to continue, the program will resume normal operation.
Definition at line 62 of file sig.c.
References abend(), and signal_handler().
Referenced by exec_objects(), fork_exec(), init_pick(), and main().
| void signal_handler | ( | int | sig_num | ) |
Signal handler for interrupt signals.
| sig_num | The signal number received |
Definition at line 95 of file sig.c.
References abend(), set_sane_tioctl(), shell_tioctl, sig_received, and ssnprintf().
Referenced by sig_prog_mode().