]> Savannah Git Hosting - gnulib.git/commitdiff
get-rusage-data: Avoid crash on Haiku.
authorBruno Haible <bruno@clisp.org>
Sun, 29 Oct 2017 13:34:21 +0000 (14:34 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 29 Oct 2017 20:27:52 +0000 (21:27 +0100)
ChangeLog
lib/get-rusage-data.c

index 96a2f8568de34b70cb6d87c3a1f0d5d7479aa8ff..66d0ef604a9a70df570505fdad409268611a183b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-29  Bruno Haible  <bruno@clisp.org>
+
+       get-rusage-data: Avoid crash on Haiku.
+       * lib/get-rusage-data.c: Avoid the setlimit-based implementation.
+
 2017-10-29  Bruno Haible  <bruno@clisp.org>
 
        get-rusage-as: Avoid crash on Haiku.
index b55e72706098e38fda8d5523f9eb729473a484e0..1966a6ef7b6b1f95c856c305e5e16aa17f134bda 100644 (file)
 
    BeOS, Haiku:
      a) On BeOS, there is no setrlimit function.
-        On Haiku, setrlimit exists. RLIMIT_DATA is defined but unsupported:
-        getrlimit of RLIMIT_DATA always fails with errno = EINVAL.
+        On Haiku, setrlimit exists. RLIMIT_DATA is defined but setrlimit fails.
      b) There is a specific BeOS API: get_next_area_info().
  */
 
 #if !(defined __APPLE__ && defined __MACH__) || defined TEST
 /* Implement get_rusage_data_via_setrlimit().  */
 
-# if HAVE_SETRLIMIT && defined RLIMIT_DATA
+# if HAVE_SETRLIMIT && defined RLIMIT_DATA && !defined __HAIKU__
 
 #  ifdef _AIX
 #   define errno_expected() (errno == EINVAL || errno == EFAULT)
@@ -409,7 +408,7 @@ get_rusage_data (void)
   /* get_rusage_data_via_setrlimit() does not work.
      Prefer get_rusage_data_via_iterator().  */
   return get_rusage_data_via_iterator ();
-#elif HAVE_SETRLIMIT && defined RLIMIT_DATA
+#elif HAVE_SETRLIMIT && defined RLIMIT_DATA && !defined __HAIKU__
 # if defined __linux__ || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __hpux || defined __sgi || defined __osf__ || defined __sun /* Linux, FreeBSD, NetBSD, OpenBSD, AIX, HP-UX, IRIX, OSF/1, Solaris */
   /* get_rusage_data_via_setrlimit() works.  */
   return get_rusage_data_via_setrlimit ();