196#if !defined(LIBMESH_HAVE_FEENABLEEXCEPT) && defined(LIBMESH_HAVE_XMMINTRIN_H)
197 static int flags = 0;
202#ifdef LIBMESH_HAVE_FEENABLEEXCEPT
203 feenableexcept(FE_DIVBYZERO | FE_INVALID);
204#elif LIBMESH_HAVE_XMMINTRIN_H
205 flags = _MM_GET_EXCEPTION_MASK();
206 _MM_SET_EXCEPTION_MASK(flags & ~_MM_MASK_INVALID);
209#if LIBMESH_HAVE_DECL_SIGACTION
210 struct sigaction new_action, old_action;
213 new_action.sa_sigaction = libmesh_handleFPE;
214 sigemptyset (&new_action.sa_mask);
215 new_action.sa_flags = SA_SIGINFO;
217 sigaction (SIGFPE,
nullptr, &old_action);
218 if (old_action.sa_handler != SIG_IGN)
219 sigaction (SIGFPE, &new_action,
nullptr);
224#ifdef LIBMESH_HAVE_FEDISABLEEXCEPT
225 fedisableexcept(FE_DIVBYZERO | FE_INVALID);
226#elif LIBMESH_HAVE_XMMINTRIN_H
227 _MM_SET_EXCEPTION_MASK(flags);
229 signal(SIGFPE, SIG_DFL);
238#if LIBMESH_HAVE_DECL_SIGACTION
239 static struct sigaction old_action;
240 static bool was_on =
false;
244 struct sigaction new_action;
248 new_action.sa_sigaction = libmesh_handleSEGV;
249 sigemptyset (&new_action.sa_mask);
250 new_action.sa_flags = SA_SIGINFO;
252 sigaction (SIGSEGV, &new_action, &old_action);
257 sigaction (SIGSEGV, &old_action,
nullptr);
260 libmesh_error_msg(
"System call sigaction not supported.");
268#if LIBMESH_HAVE_DECL_SIGACTION
269 static struct sigaction old_action;
270 static bool was_on =
false;
274 struct sigaction new_action;
278 new_action.sa_sigaction = libmesh_handleSIGINT;
279 sigemptyset (&new_action.sa_mask);
280 new_action.sa_flags = SA_SIGINFO;
282 sigaction (SIGINT, &new_action, &old_action);
287 sigaction (SIGINT, &old_action,
nullptr);
290 libmesh_error_msg(
"System call sigaction not supported.");