23 #ifndef __UT_Signal_h__
24 #define __UT_Signal_h__
43 #define SIGTRAP 5 // Unhandled
44 #define SIGEMT 7 // Unhandled
46 #define SIGKILL 9 // Unhandled
47 #define SIGBUS 10 // Unhandled
49 #define SIGSYS 12 // Unhandled
51 #define SIGALRM 14 // Unhandled
53 #define SIGUSR1 16 // Windows: IOINT?
54 #define SIGUSR2 17 // Windows: STOP?
57 #define SIGCLD 18 // Unhandled
59 #define SIGCHLD 18 // Unhandled
60 #define SIGPWR 19 // Unhandled
61 #define SIGWINCH 20 // Unhandled
67 #define SIGSTOP 23 // Unhandled
68 #define SIGTSTP 24 // Unhandled
69 #define SIGCONT 25 // Unhandled
70 #define SIGTTIN 26 // Unhandled
71 #define SIGTTOU 27 // Unhandled
72 #define SIGVTALRM 28 // Unhandled
73 #define SIGPROF 29 // Unhandled
74 #define SIGXCPU 30 // Unhandled
75 #define SIGXFSZ 31 // Unhandled
76 #define SIG32 32 // Unhandled
79 #define SIGPOLL 65 // Unhandled
81 #define sigset(a,b) signal(a,b)
85 #if defined(SIGUNUSED)
86 #define SIGEMT SIGUNUSED
93 #if defined(SIGUNUSED)
94 #define SIGSYS SIGUNUSED
102 #define UT_MAX_SIGNALS 64 // Allow for POSIX standard
104 #if defined(LINUX) || defined(MBSD)
105 #define SUPPORTS_SIGINFO
112 : mySignalNum(signal_num),
113 myOpaqueCPUContext(0),
114 myDepthFromSignalHandler(0)
123 : mySignalNum(sig_arg.mySignalNum),
124 #ifdef SUPPORTS_SIGINFO
125 mySignalInfo(sig_arg.mySignalInfo),
127 myOpaqueCPUContext(sig_arg.myOpaqueCPUContext),
128 myDepthFromSignalHandler(sig_arg.myDepthFromSignalHandler + 1),
129 myUserData(sig_arg.myUserData)
135 #ifdef SUPPORTS_SIGINFO
136 void setSignalInfo(siginfo_t *signal_info)
138 mySignalInfo = signal_info;
140 const siginfo_t *getSignalInfo()
const {
return mySignalInfo; }
144 myOpaqueCPUContext = opaque_cpu_context;
149 {
return myDepthFromSignalHandler; }
154 void *myUserData =
nullptr;
156 void *myOpaqueCPUContext;
157 int myDepthFromSignalHandler;
158 #ifdef SUPPORTS_SIGINFO
159 siginfo_t *mySignalInfo;
166 #if !defined(LINUX) && !defined(MBSD)
189 bool ignore_prev=
false);
191 bool ignore_prev=
false,
192 void* user_data =
nullptr);
200 template <std::
size_t Size>
202 bool ignore_prev=
false)
204 constructPriv(signums, Size, handler, ignore_prev,
nullptr);
206 template <std::
size_t Size>
208 bool ignore_prev=
false,
209 void* user_data =
nullptr)
211 constructPriv(signums, Size, handler, ignore_prev, user_data);
214 bool ignore_prev =
false,
215 void *user_data =
nullptr);
218 bool ignore_prev =
false);
231 bool ignore_prev=
false);
233 bool ignore_prev=
false,
234 void* user_data =
nullptr);
237 void removeSignal(
int sig);
244 static void disableCantReturn(
bool disable);
250 class UT_API UT_ComboSignalHandler
253 UT_ComboSignalHandler();
262 void operator()(
int signal_num,
263 #ifdef SUPPORTS_SIGINFO
264 siginfo_t *signal_info,
266 void *opaque_cpu_context)
const;
267 void setUserData(
void *user_data) { myUserData = user_data; }
270 mySigHandler.myNewStyle =
nullptr;
271 myUserData =
nullptr;
280 bool myIsOldStyleSigHandler;
281 void *myUserData =
nullptr;
284 void constructPriv(
int signum,
285 UT_ComboSignalHandler handler,
288 void constructPriv(
const int signums[],
289 const std::size_t
size,
290 UT_ComboSignalHandler handler,
293 void addSignal(
int signum, UT_ComboSignalHandler handler,
295 void removeSignal_(
int signum);
296 void updateActuals();
297 void overridePriv(
int signum,
298 UT_ComboSignalHandler handler,
302 static void processSignal(
int signal_num
303 #ifdef SUPPORTS_SIGINFO
304 , siginfo_t *,
void *
311 UT_Signal *myNext =
nullptr, *myPrev =
nullptr;
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
void(* UToldStyleSigHandler)(int)
UT_Signal(const int(&signums)[Size], UToldStyleSigHandler handler=SIG_DFL, bool ignore_prev=false)
UTsignalHandlerArg(int signal_num)
UT_Signal(const int(&signums)[Size], UTsigHandler handler, bool ignore_prev=false, void *user_data=nullptr)
void setUserData(void *user_data)
void setSignalContext(void *opaque_cpu_context)
LeafData & operator=(const LeafData &)=delete
UTsignalHandlerArg(const UTsignalHandlerArg &sig_arg)
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void(* UTsigHandler)(UTsignalHandlerArg)
const void * getOpaqueCPUContext() const
int getDepthFromSignalHandler() const