diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-15 01:59:16 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-15 01:59:16 +0000 |
commit | f6f2cbad1b6ebe6cb09a9bfa0b861efa9a74c02d (patch) | |
tree | 3e4ef98f4f2f86b9fd402c4fe5327a7f75d27bf7 /thread_pthread.c | |
parent | 5fb86083f1b6e995d0e2a7a9450de8318a2461cc (diff) | |
download | ruby-f6f2cbad1b6ebe6cb09a9bfa0b861efa9a74c02d.tar.gz |
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.c | 4 |
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; |