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

index 9bfd408f39999567f5a7228078b9245263f694e5..96a2f8568de34b70cb6d87c3a1f0d5d7479aa8ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-29  Bruno Haible  <bruno@clisp.org>
+
+       get-rusage-as: Avoid crash on Haiku.
+       * lib/get-rusage-as.c: Avoid the setlimit-based implementation.
+
 2017-10-29  Bruno Haible  <bruno@clisp.org>
 
        ilogbl: Ensure replacement on Haiku.
index 5de4e4e55e88804366281ae877c0524abebd7ae1..eed267320b95d7d8afd16cc7096b8be8d0fd8146 100644 (file)
 
    BeOS, Haiku:
      a) On BeOS, there is no setrlimit function.
-        On Haiku, setrlimit exists. RLIMIT_AS is defined but unsupported.
+        On Haiku, setrlimit exists. RLIMIT_AS is defined but setrlimit fails.
      b) There is a specific BeOS API: get_next_area_info().
  */
 
 #include "vma-iter.h"
 
 
-#if HAVE_SETRLIMIT && defined RLIMIT_AS && HAVE_SYS_MMAN_H && HAVE_MPROTECT
+#if HAVE_SETRLIMIT && defined RLIMIT_AS && HAVE_SYS_MMAN_H && HAVE_MPROTECT && !defined __HAIKU__
 
 static uintptr_t
 get_rusage_as_via_setrlimit (void)
@@ -365,7 +365,7 @@ get_rusage_as (void)
   /* get_rusage_as_via_setrlimit() does not work.
      Prefer get_rusage_as_via_iterator().  */
   return get_rusage_as_via_iterator ();
-#elif HAVE_SETRLIMIT && defined RLIMIT_AS && HAVE_SYS_MMAN_H && HAVE_MPROTECT
+#elif HAVE_SETRLIMIT && defined RLIMIT_AS && HAVE_SYS_MMAN_H && HAVE_MPROTECT && !defined __HAIKU__
   /* Prefer get_rusage_as_via_setrlimit() if it succeeds,
      because the caller may want to use the result with setrlimit().  */
   uintptr_t result;