From 239c9942439817e3075b57612b028ada546aea0d Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 28 Jan 2014 06:29:51 +0000 Subject: [PATCH] * thread_pthread.c: rlimit is only available on Linux. At least r44712 breaks FreeBSD. [ruby-core:60113] [Bug #9454] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ thread_pthread.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1e0063ccba..1c069a056e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jan 28 15:27:36 2014 NARUSE, Yui + + * thread_pthread.c: rlimit is only available on Linux. + At least r44712 breaks FreeBSD. + [ruby-core:60113] [Bug #9454] + Tue Jan 28 15:17:59 2014 Zachary Scott * lib/set.rb: [DOC] Add examples for Set#intersect? and Set#disjoint? diff --git a/thread_pthread.c b/thread_pthread.c index b998083dca..63da3c9799 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1562,7 +1562,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) if (th) { size = th->machine.stack_maxsize; -#if defined(HAVE_GETRLIMIT) && MAINSTACKADDR_AVAILABLE +#if defined(HAVE_GETRLIMIT) && defined(__linux__) && MAINSTACKADDR_AVAILABLE if (pthread_equal(th->thread_id, native_main_thread.id)) { struct rlimit rlim; if (getrlimit(RLIMIT_STACK, &rlim) == 0 && rlim.rlim_cur > size) {