summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2017-10-29 14:33:52 +0100
committerBruno Haible <bruno@clisp.org>2017-10-29 21:27:51 +0100
commit34a992bf8faa8abb66e8666d76f47b685642918f (patch)
treea2b40998113d78dff35d63ab69fd15fa869b97e1
parent625f7aea332a6b43fd9be4ce91d805182a5feb0c (diff)
downloadgnulib-34a992bf8faa8abb66e8666d76f47b685642918f.tar.gz
get-rusage-as: Avoid crash on Haiku.
-rw-r--r--ChangeLog5
-rw-r--r--lib/get-rusage-as.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9bfd408f39..96a2f8568d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
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.
* m4/ilogbl.m4 (gl_FUNC_ILOGBL): Invoke gl_FUNC_ILOGBL_WORKS and set
REPLACE_ILOGBL if ilogbl does not work.
diff --git a/lib/get-rusage-as.c b/lib/get-rusage-as.c
index 5de4e4e55e..eed267320b 100644
--- a/lib/get-rusage-as.c
+++ b/lib/get-rusage-as.c
@@ -112,7 +112,7 @@
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().
*/
@@ -150,7 +150,7 @@
#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;