1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
/*
Title: sighandler.h
Copyright (c) 2000-7 David C.J. Matthews
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SIGHANDLER_H
#define _SIGHANDLER_H 1
class SaveVecEntry;
typedef SaveVecEntry *Handle;
class TaskData;
extern Handle Sig_dispatch_c(TaskData *taskData, Handle handler, Handle sig);
extern void markSignalInuse(int sig);
#ifdef WINDOWS_PC
extern void RequestConsoleInterrupt(void);
#else
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
extern void init_asyncmask(sigset_t *mask);
#define SIG_HANDLER_ARGS(_sig,_contxt) int _sig, siginfo_t *, void *_contxt
typedef void (*signal_handler_type)(SIG_HANDLER_ARGS(s, c));
extern bool setSignalHandler(int sig, signal_handler_type func);
// Set up per-thread signal data: basically signal stack.
extern void initThreadSignals(TaskData *taskData);
#endif /* ! WIN32 */
extern unsigned receivedSignalCount; // Incremented each time we get a signal
#endif
|