Server Wait On Clients System - API Documentation
v1.6.4
Server Wait On Clients System.
|
Header file for signal handling. More...
#include <libmgec/mge-portability.h>
Go to the source code of this file.
Functions | |
BEGIN_C_DECLS void | init_sig_handle (void) |
Initialise signal handler. More... | |
void | termination_handler (int signum) |
Handler for caught signals. More... | |
Header file for signal handling.
Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0-only
BEGIN_C_DECLS void init_sig_handle | ( | void | ) |
Initialise signal handler.
Block all other caught signals whilst the handler processes.
void termination_handler | ( | int | signum | ) |
Handler for caught signals.
There are 2 possibilities here:-
Catch, process and terminate
or
Catch, process and continue.
Catch, process and terminate is straight forward as the easiest way to terminate is to re-raise the signal using the default hander.
Catch, process and continue has 2 forms:-
Continue via simple return
or
Continue via re-raise the signal using the default handler.
The simple return is just that.
Re-raise the signal using the default handler is required for instance with SIGTSTP (Ctrl-Z). This is because in a terminal the default handler ensures the stopped process is in the background and control is passed back to the shell, (fg can then be used to resume the process). This means that SIGTSTP is now set to use the default handler, hence this relies on SIGCONT to explicitly reset the SIGTSTP handler.
signum | The signal number. |