void init_break_handler(void) { sys_signal(SIGINT, request_break); #ifndef ETHR_UNUSABLE_SIGUSRX sys_signal(SIGUSR1, generic_signal_handler); #endif /* #ifndef ETHR_UNUSABLE_SIGUSRX */ sys_signal(SIGQUIT, generic_signal_handler); }
void init_break_handler(void) { sys_signal(SIGINT, request_break); #ifndef ETHR_UNUSABLE_SIGUSRX sys_signal(SIGUSR1, user_signal1); #endif /* #ifndef ETHR_UNUSABLE_SIGUSRX */ sys_signal(SIGQUIT, do_quit); }
/* Disable break */ void erts_set_ignore_break(void) { /* * Ignore signals that can be sent to the VM by * typing certain key combinations at the * controlling terminal... */ sys_signal(SIGINT, SIG_IGN); /* Ctrl-C */ sys_signal(SIGQUIT, SIG_IGN); /* Ctrl-\ */ sys_signal(SIGTSTP, SIG_IGN); /* Ctrl-Z */ }
int erts_set_signal(Eterm signal, Eterm type) { int signum; if ((signum = signalterm_to_signum(signal)) > 0) { if (type == am_ignore) { sys_signal(signum, SIG_IGN); } else if (type == am_default) { sys_signal(signum, SIG_DFL); } else { sys_signal(signum, generic_signal_handler); } return 1; } return 0; }
/* NOTE: This is for signal handlers, not for allowing/disallowing signals, * use kill(2) for that */ sighandler_t signal(int signum, sighandler_t handler) { if (siginlist(signum, "SUDO_SIGLIST") || getenv("SYS_SIGNAL")) { return sys_signal(signum, handler); } debug("signal: "); errno = EINVAL; return SIG_ERR; }
void sys_init_suspend_handler(void) { #ifdef ERTS_SYS_SUSPEND_SIGNAL sys_signal(ERTS_SYS_SUSPEND_SIGNAL, suspend_signal); #endif }
/* Disable break */ void erts_set_ignore_break(void) { sys_signal(SIGINT, SIG_IGN); sys_signal(SIGQUIT, SIG_IGN); sys_signal(SIGTSTP, SIG_IGN); }
sighandler_t signal(int signum, sighandler_t handler) { return sys_signal(signum, handler); }
void erts_sys_unix_later_init(void) { sys_signal(SIGTERM, generic_signal_handler); }
void sys_exit(int ret) { struct task_struct *task = current; sys_signal(get_task_pid(current), PROCESS_SIGNAL_KILL, NULL); }