summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-15 01:59:16 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-15 01:59:16 +0000
commit50700c4d3ceded853dac685e7c3671a839f9dec3 (patch)
tree3e4ef98f4f2f86b9fd402c4fe5327a7f75d27bf7 /thread_pthread.c
parent8df47f8c8d85399cdbe974d83cc5f488bd8603c0 (diff)
thread_pthread.c: Use `getpagesize()` when `pthread_attr_getguardsize` is unavailable
This is also for emscripten. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 381114d1ce..d36c149483 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -561,8 +561,12 @@ get_stack(void **addr, size_t *size)
CHECK_ERR(pthread_attr_getstackaddr(&attr, addr));
CHECK_ERR(pthread_attr_getstacksize(&attr, size));
# endif
+# ifdef HAVE_PTHREAD_ATTR_GETGUARDSIZE
CHECK_ERR(pthread_attr_getguardsize(&attr, &guard));
*size -= guard;
+# else
+ *size -= getpagesize();
+# endif
pthread_attr_destroy(&attr);
#elif defined HAVE_PTHREAD_ATTR_GET_NP /* FreeBSD, DragonFly BSD, NetBSD */
pthread_attr_t attr;