about summary refs log tree commit diff
path: root/math/test-fenv.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/test-fenv.c')
-rw-r--r--math/test-fenv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/math/test-fenv.c b/math/test-fenv.c
index 4da2e37dae..ab09410690 100644
--- a/math/test-fenv.c
+++ b/math/test-fenv.c
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/wait.h>
+#include <sys/resource.h>
 
 /*
   Since not all architectures might define all exceptions, we define
@@ -249,6 +250,14 @@ feenv_nomask_test (const char *flag_name, int fe_exc)
   pid = fork  ();
   if (pid == 0)
     {
+#ifdef RLIMIT_CORE
+      /* Try to avoid dumping core.  */
+      struct rlimit core_limit;
+      core_limit.rlim_cur = 0;
+      core_limit.rlim_max = 0;
+      setrlimit (RLIMIT_CORE, &core_limit);
+#endif
+
       fesetenv (FE_NOMASK_ENV);
       feraiseexcept (fe_exc);
       exit (2);
@@ -293,6 +302,14 @@ feenv_mask_test (const char *flag_name, int fe_exc)
   pid = fork ();
   if (pid == 0)
     {
+#ifdef RLIMIT_CORE
+      /* Try to avoid dumping core.  */
+      struct rlimit core_limit;
+      core_limit.rlim_cur = 0;
+      core_limit.rlim_max = 0;
+      setrlimit (RLIMIT_CORE, &core_limit);
+#endif
+
       fesetenv (FE_DFL_ENV);
       feraiseexcept (fe_exc);
       exit (2);