Handle various OS signals. More...
|typedef void(*||Signal_Handler_t )(int)|
|static Signal_Handler_t||wrap_signal (int sig, Signal_Handler_t handler)|
|Wrapper around signal() which it is safe to take the address of, in case signal itself is hidden by some some macro magic. |
|static void||handle_signal_suspend (int sig)|
|Handle signals – suspend. |
|static void||handle_signal_simple (int sig)|
|Handle signals – simple (interrupt and quit) |
|static void||handle_signal_abort (int sig)|
|Handle signal – abort, kill, etc. |
|Ignore SIGTSTP signals (keyboard suspend) |
|Handle SIGTSTP signals (keyboard suspend) |
|Prepare to handle the relevant signals. |
|static Signal_Handler_t(*||signal_aux )(int, Signal_Handler_t) = wrap_signal|
Handle various OS signals.
Copyright (c) 1997 Ben Harrison
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
Handle signals – simple (interrupt and quit)
This function was causing a huge number of problems, so it has been simplified greatly. We keep a global variable which counts the number of times the user attempts to kill the process, and we commit suicide if the user does this a certain number of times.
We attempt to give "feedback" to the user as he approaches the suicide thresh-hold, but without penalizing accidental keypresses.
To prevent messy accidents, we should reset this global variable whenever the user enters a keypress, or something like that.
References character_generated, character_saved, close_game(), COLOUR_WHITE, player::died_from, FALSE, player::is_dead, my_strcpy(), player_upkeep::playing, quit(), signal_aux, signal_count, Term_erase(), Term_fresh(), Term_putstr(), Term_xtra(), TERM_XTRA_NOISE, TRUE, player::upkeep, and void().
Referenced by signals_init().
Prepare to handle the relevant signals.
SIGDANGER: This is not a common (POSIX, SYSV, BSD) signal, it is used by AIX(?) to signal that the system will soon be out of memory.
Referenced by main().
Wrapper around signal() which it is safe to take the address of, in case signal itself is hidden by some some macro magic.